-->
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: Checking isDirty on fields
PostPosted: Tue Jan 27, 2004 11:16 am 
Newbie

Joined: Thu Jan 08, 2004 6:28 am
Posts: 11
Hey,

I have this code:

Code:
Session session = sessionFactory.openSession();
Transaction tx = session.beginTransaction();
UserVO user = (UserVO) session.load(UserVO.class, id);
user.setMail("test@test.com");
tx.commit();
session.close();


I expected Hibernate to only update the mail column but when I saw the log I noticed that it update all the colums:

Code:
Hibernate: select id from UserVO where id =?
Hibernate: update UserVO set name=?, mail=?, age=?, country=? where id=?


Did I do something wrong? Or this is the behavior of Hibernate?

Avi


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 27, 2004 11:20 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
This is default behaviour. Use dynamic-update=true to change it.


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.