-->
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: HibernateToolTask and the <generator class="assigned
PostPosted: Mon Feb 20, 2006 5:39 pm 
Newbie

Joined: Mon Jun 20, 2005 12:31 pm
Posts: 14
I have been using the ant task to generate my hbm.xml files.
However i noticed that by default every object i generate this way, primary keys are defaulted to <generator class="assigned"/>

is there any way to cause the default primary key to be

<generator class="native"/>


Ive been search for docs on how to do this but have found nothing yet.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2006 1:34 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no default option available (yet).

you can specify explicit generator like this:
<!-- table allows you to override/define how reverse engineering
are done for a specific table -->
<table name="ORDERS">
<primary-key>
<generator class="sequence">
<param name="table">seq_table</param>
</generator>
<column name="CUSTID" foreign-table="CUSTOMER" foreign-column="CUSTID" />
</primary-key>
<column name="NAME" property="orderName" type="string" />
</table>


above is from http://www.hibernate.org/hib_docs/tools ... ml_single/

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