-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Generating DAO classes with different content
PostPosted: Thu Oct 11, 2007 9:28 am 
Newbie

Joined: Thu Aug 16, 2007 2:25 pm
Posts: 5
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.

_________________
Rodrigo Avila
rodrigo@avila.eti.br

http://www.avila.eti.br


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 12, 2007 2:46 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
change the templates.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.