I set the value of dirty flags in my queries i.e.

SELECT 0 as IsDirty, ...
FROM...

Then I map the IsDirty to the entities property in my resultMap.

Hope this helps.

Rafi


-----Original Message-----
From: Sal Bass [mailto:salbass...@hotmail.com] 
Sent: Thursday, May 28, 2009 10:55 AM
To: user-cs@ibatis.apache.org
Subject: Dirty Tracking Issue


I am having a dilema with implementing dirty tracking on my entities. I am 
using AOP to mark an entity as "dirty" when a property is set. The problem 
occurs when I load the entities using Ibatis because it sets the properties 
during mapping which makes the entity dirty (no, I can't use constructor 
mapping here). So, I use a RowDelegate to mark the entity clean before 
returning it. Works great....except for when I am loading a root object with 
several complex properties (ILists of other entities). The RowDelegate is 
obviously not fired for each complex property, so they are returned as dirty.
 
Any idea of how I can get at all of the complex properties to mark them clean 
before returning the entity?
 

 
_________________________________________________________________
Hotmail(r) goes with you. 
http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009

Reply via email to