-->
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.  [ 4 posts ] 
Author Message
 Post subject: Is it possible to update without load?
PostPosted: Sun Jun 13, 2004 7:11 am 
Newbie

Joined: Sun Jun 13, 2004 6:59 am
Posts: 2
Simple question, I think, but I can't find the answer in the forums.
I'm trying to work out a way of updating a property without loading first, something like:
VO valueObject = new VO();
valueobject.setPK(existingPK);
valueobject.setApproved(true);
session.update(valueobject);

This is just to avoid having to avoid loading the object to set a single attribute.
Thanks for any suggestions.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 13, 2004 1:48 pm 
Beginner
Beginner

Joined: Mon Sep 29, 2003 10:32 pm
Posts: 35
Location: Toronto, Ontario
Yes you can update a detached object in a new session without reloading it. See section 9.4.2 in the Hibernate documentation.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 13, 2004 3:51 pm 
Newbie

Joined: Sun Jun 13, 2004 6:59 am
Posts: 2
No, I understand how I can use a detached object. What I want to know is how to do it *without* having a detached object. Is there any way to instantiate a new value object, set the key and new property values, and then update only those new properties?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 13, 2004 6:35 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Use JDBC directly.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.