ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "rs" <rustyst...@myway.com>
Subject Modified state verification
Date Sat, 17 Jun 2006 11:46:44 GMT

Hi,

Am looking for a relatively easy, generic way to check if an object was modified. For example,

... oldState = object.getState();
... propA = object.getA();
... propB = object.getB();
    object.setA(propA);
    ojbect.setB(propB);

... newState = object.getState()

if (oldState.equals(newState)) {
   // object is modified, do update
} else {
   // object is NOT modified, do nothig
}

The obvious idea I tried is to use toString() to save the object's state. The problem is that
when you have a double-sided 1:M relation between objects, then toString() will result in
a endless loop.

Any ideas? Thanks

P.S. I know Hibernate does this automagically, I'm looking for a way how I could do something
like this with Ibatis.






_______________________________________________
No banners. No pop-ups. No kidding.
Make My Way  your home on the Web - http://www.myway.com



Mime
View raw message