public boolean hasChanged(PersistenceBroker broker)
    {
        if(hasChanged == null)
        {
            Map current = null;
            try
            {
                current = getCurrentImage();
            }
            catch(Exception e)
            {
                log.warn("Could not verify object changes, mark dirty: " + getIdentity(), e);
            }
            if(beforeImage != null && current != null)
            {
                Iterator it = beforeImage.entrySet().iterator();
                hasChanged = Boolean.FALSE;
                while(it.hasNext())
                {
                    Map.Entry entry =  (Map.Entry) it.next();
                    Image imageBefore = (Image) entry.getValue();
                    Image imageCurrent = (Image) current.get(entry.getKey());
                    if(imageBefore.modified(imageCurrent))
                    {
                        hasChanged = Boolean.TRUE;
                        break;
                    }
                }
            }
            else
            {
                hasChanged = Boolean.TRUE;
            }
            if(log.isDebugEnabled())
            {
                log.debug("State detection for " + getIdentity() + " --> object "
                        + (hasChanged.booleanValue() ? "has changed" : "unchanged"));
            }
        }
        return hasChanged.booleanValue();
    }
public boolean hasChanged ( PersistenceBroker broker ) { if ( hasChanged == null ) { Map current = null ; try { current = getCurrentImage ( ) ; } catch ( Exception e ) { log . warn ( "Could not verify object changes, mark dirty: " + getIdentity ( ) , e ) ; } if ( beforeImage != null && current != null ) { Iterator it = beforeImage . entrySet ( ) . iterator ( ) ; hasChanged = Boolean . FALSE ; while ( it . hasNext ( ) ) { Map . Entry entry = ( Map . Entry ) it . next ( ) ; Image imageBefore = ( Image ) entry . getValue ( ) ; Image imageCurrent = ( Image ) current . get ( entry . getKey ( ) ) ; if ( imageBefore . modified ( imageCurrent ) ) { hasChanged = Boolean . TRUE ; break ; } } } else { hasChanged = Boolean . TRUE ; } if ( log . isDebugEnabled ( ) ) { log . debug ( "State detection for " + getIdentity ( ) + " --> object " + ( hasChanged . booleanValue ( ) ? "has changed" : "unchanged" ) ) ; } } return hasChanged . booleanValue ( ) ; }
For internal use only! Only call immediately before commit to guarantee
that all changes can be detected (because this method cache the detected "change state"
thus on eager call changes could be ignored). Checks whether object and internal clone
differ and returns <em>true</em> if so, returns <em>false</em> else.

@return boolean The result.