-->
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.  [ 1 post ] 
Author Message
 Post subject: On-demand generator in hibernate
PostPosted: Thu Dec 16, 2010 5:46 am 
Newbie

Joined: Wed Dec 15, 2010 9:14 am
Posts: 2
I hope this is not a old question.
I am writing a code where I need to get the next value from Oracle Sequence.

One way to do it from Hibernate is using SQLQuery ‘select Seq.nexval from dual’.
The problem is it doesn’t work on all DBs. (We use HSQL for Junit testing and it fails badly)

Another way is to use Hibernate Generator.
But I have always seen generator being used along with ‘id’ so it is auto-generated.
Is there a way I can use it with normal column (non-id-property) on demand.

Thanks
ankey


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.