-->
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.  [ 4 posts ] 
Author Message
 Post subject: using sequence generator without id
PostPosted: Wed May 30, 2007 3:22 am 
Newbie

Joined: Tue Jan 31, 2006 8:00 am
Posts: 14
Hi All

I have a table which already has a composite key id.
Now i have a column in this table which is not part of the composite key.
I want to populate this column via a sequence generator. In this regard I would like to know how to use a sequence generator on a column without making it a primary key Id.

Do post your thoughts on the same


Regards,


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 30, 2007 9:40 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Several options but the most obvious one is to use a DB Trigger and set the property to be read only.


Top
 Profile  
 
 Post subject: sequence for non - id columns
PostPosted: Mon Jun 04, 2007 6:21 am 
Newbie

Joined: Tue Jan 31, 2006 8:00 am
Posts: 14
Hey David,

Currently we are using the trigger appraoch. What we wanted to know is if this can be taken care at the Hibernate level.

Regards


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 04, 2007 8:55 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
What you are doing is the best approach. Stay with it - nothing wrong with using the power of the database.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.