-->
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: Adding a condition to session.save()
PostPosted: Wed Nov 25, 2009 2:09 pm 
Newbie

Joined: Thu Mar 13, 2008 12:20 pm
Posts: 3
Hi,

I have an application where each object in the system has an owner. Only the owner is allowed to update the object.

Is it possible to add a condition to the session.save() so that it would execute SQL such as
update SomeObject set field1=?,field2=?,field3=? where id=? and owner=?

I'm trying to avoid doing an additional select to read back the object and verify it. Although if it did come to that, what would be the best way, an interceptor?

Thanks,
Al


Top
 Profile  
 
 Post subject: Re: Adding a condition to session.save()
PostPosted: Thu Nov 26, 2009 8:50 am 
Newbie

Joined: Thu Mar 13, 2008 12:20 pm
Posts: 3
Thought about adding a second version element to the Objects, but that's not allowed :(


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.