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: Primary Key
PostPosted: Fri Nov 23, 2007 3:26 am 
Newbie

Joined: Fri Nov 23, 2007 3:08 am
Posts: 4
Hi

I want to create a table where the primary key looks like the following
A00000000 .. A99999999
B00000000 .. B99999999
C00000000 .. C99999999

How can configure this in Hibernate?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 23, 2007 5:08 am 
Expert
Expert

Joined: Thu May 26, 2005 9:19 am
Posts: 262
Location: Oak Creek, WI
Are u trying for the option of increment in PK with your requirement???

If you can do it manually keep the value to be assigned....And you can achieve urs but without auto-incrementing...

_________________
RamnathN
Senior Software Engineer
http://www.linkedin.com/in/ramnathn
Don't forget to rate.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 23, 2007 5:54 am 
Newbie

Joined: Fri Nov 23, 2007 3:08 am
Posts: 4
I guess you are suggesting

Code:
<generator class="assigned"/>

then I have to increase the counter from the database and manually generate the key.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 23, 2007 7:49 am 
Expert
Expert

Joined: Thu May 26, 2005 9:19 am
Posts: 262
Location: Oak Creek, WI
Yes.....increment will work in Integer.....May be wait for others to reply:-)

_________________
RamnathN
Senior Software Engineer
http://www.linkedin.com/in/ramnathn
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.  [ 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.