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: "autoincrement" on an non primary-key
PostPosted: Tue Jun 30, 2009 4:46 am 
Newbie

Joined: Tue Feb 10, 2009 3:29 am
Posts: 5
Hi,
i working since one month with hibernate and now i have a problem and i hope you can give me some tip. I create a simple Table for my test application to learn hibernate. In this table i have a id (as primary key) some char values and a numberic value (Integer number) . My problem is, that i will increment automaticly the numberic value (number) when the object will persist.
At the moment i have no idea, how i can do this. Its this possible to do this with hibernate?

Big thanks for your help!


Top
 Profile  
 
 Post subject: Re: "autoincrement" on an non primary-key
PostPosted: Wed Jul 01, 2009 8:01 am 
Newbie

Joined: Mon Mar 26, 2007 3:33 am
Posts: 18
which database r u using?

if Oracle u can use sequence and identity with sybase? might be it will not work as Id. you can insert next sequence for Integer column.


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.