-->
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.  [ 4 posts ] 
Author Message
 Post subject: "hbm2dao" doesn't produce JPA-compliant code
PostPosted: Wed Dec 27, 2006 10:14 am 
Newbie

Joined: Wed Dec 27, 2006 10:03 am
Posts: 19
Hi there!

I've faced with not very big issue, but I think it's still worth-asking. I try to stick to JPA interfaces in my application, but DAO objects that have been generated for me by "hbm2dao" seem to be non JPA-compliant: they use
Code:
org.hibernate.SessionFactory
instead of
Code:
javax.persistence.EntityManagerFactory


So my question is: if there is no way to produce JPA-compliant DAO code with "hbm2dao", how do I write my own DAO template and feed it to this task, so it worked instead of default one, daohome.ftl?

Does hbm2dao support custom templates at all?

thanks,
sonar


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 27, 2006 12:51 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
try and set ejb3="true"

not sure if it generates code compliant with the released spec - patches welcome.

dao/*.ftl is what you need to overwrite, so yes it does support custom templates.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 27, 2006 1:04 pm 
Newbie

Joined: Wed Dec 27, 2006 10:03 am
Posts: 19
Thanks for the reply!

ok, so how exactly I may replace default template? Where should I put my custom one?

sonar


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 27, 2006 1:07 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
just like with all the other templates ;)

just put them in a directory that templatepath attribute points to and copy the structure that is in hibernate-tools.jar

_________________
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.  [ 4 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.