Advertisement
Guest User

Untitled

a guest
Jul 14th, 2011
527
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. @Repository
  2. public class TestServiceDAOImpl implements TestServiceDAO{
  3.  
  4. private SessionFactory sessionFactory;
  5.  
  6. public String getResponse(){
  7. Session session = sessionFactory.getCurrentSession();
  8. session.beginTransaction();
  9.  
  10. Query query = session.createQuery("dummy query");
  11. String response = query.uniqueResult();
  12.  
  13. session.close();
  14.  
  15. return query;
  16. }
  17.  
  18. public SessionFactory getSessionFactory() {
  19. return sessionFactory;
  20. }
  21.  
  22. public void setSessionFactory(SessionFactory sessionFactory) {
  23. this.sessionFactory = sessionFactory;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement