Skip to content

Instantly share code, notes, and snippets.

@jeevan-patil
Created May 17, 2013 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeevan-patil/5597348 to your computer and use it in GitHub Desktop.
Save jeevan-patil/5597348 to your computer and use it in GitHub Desktop.
sample Spring service class
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