Skip to content

Instantly share code, notes, and snippets.

@senthilmuthiah
Created March 25, 2013 10:38
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 senthilmuthiah/5236282 to your computer and use it in GitHub Desktop.
Save senthilmuthiah/5236282 to your computer and use it in GitHub Desktop.
Address Book Using JPA +ZK + Spring.
package addressbook.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import addressbook.dao.CRUDDao;
@Service
public class CRUDServiceImpl implements CRUDService {
@Autowired
private CRUDDao CRUDDao;
@Transactional(readOnly = true)
public <T> List<T> getAll(Class<T> klass) {
return CRUDDao.getAll(klass);
}
@Transactional
public <T> T save(T t) {
T newRecord = null;
newRecord = CRUDDao.save(t);
return newRecord;
}
@Transactional
public <T> void delete(T t) {
CRUDDao.delete(t);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment