-->
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: Automatically calling update when setter called
PostPosted: Tue Nov 25, 2008 12:26 pm 
Newbie

Joined: Tue Nov 25, 2008 12:14 pm
Posts: 3
Hi,

I am running into an issue where Hibernate automatically calls update on my domain object whenever I retrieve from the database and the use a setter method to change a value. My understanding is that I should be able to set the value and then explicitly call update on the domain object in order for it to update in the dB. Please let me know what is wrong.

Thanks for your help,

anicad

Here is my code snippet:

//retrieves the appropriate record from the db based on the id
Person adult = (Person)getService().getPerson("34");

//upon setting of this ID, "update" is called to persist this to the db. //Why?
adult.setFamId(new Long("887"));


Top
 Profile  
 
 Post subject: Not enough information
PostPosted: Tue Nov 25, 2008 4:57 pm 
Newbie

Joined: Mon Oct 11, 2004 1:30 pm
Posts: 15
Location: New York, NY
You should post your mappings and related details in order to better understand.
is Family a relation? If so, maybe you could check how you have cascading set.


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.