-->
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: How to set property value using a sequence generator?
PostPosted: Sat May 05, 2007 11:26 pm 
Newbie

Joined: Wed Apr 25, 2007 10:29 pm
Posts: 5
I am sure this is documented somewhere - but be damned if I can find it:

Basically, I want to map a property such that when the object is saved or updated, it is set to a table-wide incremented value. Without using a trigger. Its essentially an incrementing "transaction id" for that table.

Its kind of like <version> - but letting me specify a generator - in this case, an oracle sequence.

Its also kind of like generated="always" - but letting me specify custom sql that sets the value on insert or update.
ala

Code:
update Issue set lastUpdateId=Issue_lastUpdateId_sequence.NEXTVAL, title='moo' where id='A9FB96DA8C6542DCA8F911E30341CBF5';


My feeling is there must be a way to do this - but I havent been able to find it. I must be blind.

Thanks.

-Nick


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 13, 2007 3:51 pm 
Newbie

Joined: Wed Apr 25, 2007 10:29 pm
Posts: 5
Is it possible?

I guess I need to raise a jira issue....

-Nick


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.