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.  [ 5 posts ] 
Author Message
 Post subject: Hibernate code geration, changing generator class
PostPosted: Tue Aug 15, 2006 6:38 am 
Beginner
Beginner

Joined: Tue Sep 16, 2003 11:26 am
Posts: 25
Location: Berlin - Germany
Hibernate Tools version:
3.2.0beta6

Hello!
I want to change the generator class in code generation template ../hbm/id.hbm.ftl:
The original code in the template id.hbm.ftl is:
Code:
<generator class="${property.value.identifierGeneratorStrategy}" />

Generation output is:
Code:
<generator class="assigned" />

I want to change this to:
Code:
<generator class="some.package.Classname" />

Do I have to do this by creating a custom template or can i also change the property property.value.identifierGeneratorStrategy in some other way? Where are these properties defined?
Thanks for your help!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 15, 2006 6:50 am 
Beginner
Beginner

Joined: Tue Sep 16, 2003 11:26 am
Posts: 25
Location: Berlin - Germany
Creating a custom template works fine. But: This is not nice, if there is a way to change the property of the original template...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 15, 2006 6:53 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
read the docs about reveng.xml

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 15, 2006 7:34 am 
Beginner
Beginner

Joined: Tue Sep 16, 2003 11:26 am
Posts: 25
Location: Berlin - Germany
I want to change the generator class for all tables.
Is it possible to change the default value for "generator class" by changing a property.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 15, 2006 7:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no, but it is possible by implementing a custom reverse enginerring strategy.

Also covered in the docs.

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