-->
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: Don't generate a composite natural key (<composite-id>)?
PostPosted: Mon Feb 28, 2011 3:42 pm 
Newbie

Joined: Thu Feb 17, 2011 10:03 am
Posts: 6
Is it possible to prevent generation of a <composite-id> element in the Hibernate mappings created by Hibernate Tools? Creation of the primary key will be handled by some DDL in a <database-object> element instead, so I would like for these columns to just be treated just like normal columns.

I've tried unchecking the "Generate basic typed composite ids" option in my Hibernate Code Generation configuration, but it has no noticeable effect.

This is tangentially related to the use case described here.


Top
 Profile  
 
 Post subject: Re: Don't generate a composite natural key (<composite-id>)?
PostPosted: Wed Mar 09, 2011 10:04 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
To prevent generation of composite id look at id.hbm.ftl and persistent-class.hbm.ftl templates and update them.
After this provide custom templates for hibernate tools. (http://docs.jboss.org/tools/2.1.0.Beta1 ... tml#d0e921 if you use eclipse plugins)


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.