-->
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: Is there a way to wrap every primary key in an Id object
PostPosted: Wed Feb 28, 2007 3:53 pm 
Newbie

Joined: Tue Nov 22, 2005 11:38 am
Posts: 3
I'm using hibernate-tools for ant.

I would like to wrap the keys for every table in an Id object, even the simple single field key table's.

Currently, Id objects only get created for tables with multiple fields as part of the key (composite-id).


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 28, 2007 4:08 pm 
Newbie

Joined: Tue Nov 22, 2005 11:38 am
Posts: 3
I partially answered my own question. To clarify, I am generating the java from the hbm.xml files.

I also generate the hbm.xml files.

I can change the id.hbm.ftl file to generate a composite-id instead of an id attribute for every field.

But, is there another option that wouldn't require template changes.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 19, 2007 11:08 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
currently we just look at the number of columns in the pk.

we could ask the revengstrategy instead and let it drive the decision; allowing you to control it. e.g. a hasCompositeIdentifier(TableIdentifier, ...)

put it in jira. patches welcome.

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