-->
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: Composite key containing a generated column
PostPosted: Mon Jan 22, 2007 11:54 am 
Newbie

Joined: Thu Jan 11, 2007 12:46 pm
Posts: 4
(I have already posted this in the NHibernate forum, since that's what I'm using, but since I have received no answers after several days, and it's not really specifically an NHibernate issue, I thought I would try posting it here as well. Sorry for the cross-post!)

I have an unusual DB schema, which however I would rather not change.

Most of my tables have a composite key. For instance, the Donor table's key is donornum plus year. Each year, I copy all Donors to the new year, retaining their donornum and incrementing the year.

However, donornum is a generated column, so that when I add a new Donor (not a copy from the previous year), it gets a generated new donornum that no other donor has. (In Firebird, it will be done by a Generator.)

Can that be modelled successfully in Hibernate?

Thanks.

_________________
Dan Cooperstock
info@FreeDonationSoftware.org


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 23, 2007 1:20 pm 
Newbie

Joined: Wed Jan 17, 2007 7:29 am
Posts: 10
This might be what you're looking for: http://www.hibernate.org/117.html#A36


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.