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.  [ 3 posts ] 
Author Message
 Post subject: Session Factory name in hbm2dao ant target
PostPosted: Tue Dec 13, 2005 1:46 pm 
Newbie

Joined: Tue Dec 13, 2005 1:40 pm
Posts: 1
I'm using the hibernate tools to reverse engineer several databases. Each database has it's own session factory name. I would like to make use of the generated DAOs, but can't because they all look up the session factory under the JNDI name "SessionFactory". Is there a way to specify the session factory name for the hbm2dao target?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 13, 2005 3:03 pm 
Hibernate Team
Hibernate Team

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

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 30, 2006 8:40 am 
Newbie

Joined: Wed Aug 30, 2006 7:45 am
Posts: 2
Hi,

I've posted a message to this hbm2dao thread recently.

I think it opens a solution to your problem, too: Simply extract the delivered daohome.ftl template from hibernate-tools.jar, rename it to some meaningful name, and drop it in your <hibernatetool> classpath.

As you will see the template references a property ${sessionFactoryName} holding the JNDI lookup string. By using the generic <hbmtemplate> task it should be sufficient to add an appropriate <property> element (and a few more already mentioned properties like ejb3 and jdk5) like this:

<property key="sessionFactoryName" value="my/jndi/path"/>

Greetings

Christian


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.