Hibernate version:
3.2
Name and version of the database you are using:
PostgreSQL 8.1
Hi all,
I read in
http://hibernate.org/42.html#A11 about the HibernateUtil class. This class works perfectly in my web application (including c3p0 pool).
But, the Hibernate Tools, in the Reverse Engineering option, has an option to generate DAO code (*home.java); but the generated DAO classes use the following code to make an sessionFactory:
Code:
return (SessionFactory) new InitialConext().lookup("SessionFactory");
and the following to use this sessionFactory:
Code:
sessionFactory.getCurrentSession()
is possible to generate this classes whitout the
Code:
getSessionFactory()
method, and using
Code:
HibernateUtil.getSession()
instead
Code:
sessionFactory.getCurrentSession()
?
Thanks the help.