-->
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.  [ 1 post ] 
Author Message
 Post subject: Primary Key with a Hibernate generated ID and another column
PostPosted: Tue Mar 06, 2007 3:05 pm 
Newbie

Joined: Thu Feb 08, 2007 4:43 pm
Posts: 7
I am a new Hibernate (v3) user. Having checked the internet (including this forum) and the Hibernate in Action book, I'm still unsure if this scenario can be handled via a Hibernate mapping file.

Scenario: The Oracle database table we are mapping to has a primary key that includes two columns: one id that should be generated (e.g. Hibernate's sequence generator), and another customer code that is required to be on all tables. Other tables have a foreign key to the generated id and customer code. I realize that this design might not be desirable, but the DBA insists this is needed.

It appears that the <composite-id> does not allow the generator tag as the <id> element allows. It seems that I could create a CompositeUserType, but I cannot find how to produce and use the Hibernate generated id.

I cannot see more than one result page from either my Internet Explorer browser or FireFox browser. So, if this has been answered previously, please provide me the link.

Thanks in advance for any help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.