Created
May 17, 2013 06:44
-
-
Save jeevan-patil/5597348 to your computer and use it in GitHub Desktop.
sample Spring service class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.transbank.online.service.impl; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Qualifier; | |
import org.springframework.stereotype.Service; | |
import org.springframework.transaction.annotation.Transactional; | |
import com.transbank.online.bean.Customer; | |
import com.transbank.online.dao.iface.CustomerDao; | |
import com.transbank.online.service.iface.CustomerService; | |
/** | |
* | |
* @author jeevan | |
* @since Apr 30, 2013 | |
* @purpose | |
* | |
*/ | |
@Service("customerService") | |
public class CustomerServiceImpl implements CustomerService { | |
private CustomerDao customerDao; | |
@Override | |
@Transactional | |
public Customer getCustomerById(String id) { | |
Customer customer = null; | |
try { | |
customer = customerDao.getCustomerById(id); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
return customer; | |
} | |
@Autowired | |
@Qualifier("customerDao") | |
public void setCustomerDao(CustomerDao customerDao) { | |
this.customerDao = customerDao; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment