Friday, April 1, 2011

Comparing DB, original and new values in Entity Object to see if things have changed

Object dbVal = getPostedAttribute(ATTRIB);
Object currentVal = this.getAttribute(ATTRIB);
return dbVal.equals(currentVal);

OR for orginal vs current


Object origVal = super.getAttribute(ATTRIB, EntityImpl.ORIGINAL_VERSION);
Object currentVal = this.getAttribute(ATTRIB);
return origVal.equals(currentVal);

No comments:

Post a Comment