-->
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: Generating a db sequence number for other-than-primary keys
PostPosted: Tue Oct 05, 2004 4:32 pm 
Newbie

Joined: Tue Oct 05, 2004 4:26 pm
Posts: 1
Hi,

I have a requirement that a non-key column of a table be updated with a brand-new number when certain types of updates happen for a row. What I want to do (in a portable manner) is to get the next sequence number from some sequence generator and assign the specific property of the persistent object to that value.

As far as I could tell, sequence number generation is tied to primary keys.

Is there any way I can access the mechanisms of getting a new sequence number without actually performing an insert into some table.

Thanks in advance.

Regards,
Krishnan


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 06, 2004 7:54 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Use the same code as in the id package. There is no built-in support

_________________
Emmanuel


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.