-->
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: Get values from a sequence manually
PostPosted: Thu Nov 19, 2009 12:51 pm 
Newbie

Joined: Thu Sep 11, 2008 10:19 am
Posts: 6
Hi there,

I've a table which is use to store protocols. Every entry represents a user action. An entry has an ID and a "changeID". This changeID groups several protocol entries to one change. This is done because one user action can result in multiple protocol entries.
Now I wonder how I can tell Hibernate to use this sequence in the way I want. Every user action produces multiple protocol entries which are persisted in one transaction. If I now use the sequence the way I would for a primary key, this would produce a different changeID for every protocol entry. But I want them to have the same changeID.
I tried to manually get the next value from the sequence with a "select x.nextval from dual" query, but then Hibernate tells me that "dual" isn't mapped.

What would you do?

Thanks in advance
Jens


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.