-->
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: How to perform "dirty" check on Persistent entity object?
PostPosted: Wed May 20, 2009 5:02 pm 
Beginner
Beginner

Joined: Tue Feb 03, 2009 4:33 pm
Posts: 21
I would like to be able to perform a "dirty" check on my entity, to avoid saving the object if it hasn't been modified. Does Hibernate offer any native facility to perform a "dirty" check?


Top
 Profile  
 
 Post subject: Re: How to perform "dirty" check on Persistent entity object?
PostPosted: Wed May 20, 2009 6:17 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
it's much simpler that than, you don't have to as Hibernate will dirty check automatically and avoids any useless SQL.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: How to perform "dirty" check on Persistent entity object?
PostPosted: Mon Oct 12, 2009 9:16 pm 
Newbie

Joined: Mon Oct 12, 2009 9:02 pm
Posts: 1
Dirty check works if I load entity object and within same Hibernate Session update entity object and save.

I use DTOs for incoming data from webpage. This DTO gets tramsformed in Entity object.

Which in turn is saved using Hibernate Session update. But dirty checking is not working in this case.

How can I enable dirty checking in this type of scenario.

I will greatly appreciate any lead on this. If needed I can post my code.

Thanks,

npm2001


Top
 Profile  
 
 Post subject: Re: How to perform "dirty" check on Persistent entity object?
PostPosted: Tue Oct 13, 2009 2:39 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
But dirty checking is not working in this case.
How can I enable dirty checking in this type of scenario.

What do you mean by "not working" ? It's always enabled.

Could you show the code about "This DTO gets tramsformed in Entity object" ?
How do you get a reference to the entity object?

Quote:
I use DTOs for incoming data from webpage. This DTO gets tramsformed in Entity object.

What a waste of time. Seam exposes entities directly, to JSF components, others and even to javascript/JSON.

_________________
Sanne
http://in.relation.to/


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.