[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3730) ManyToOneType.isModified

Riccardo Mirasola (JIRA) noreply at atlassian.com
Fri Jan 23 07:59:38 EST 2009


ManyToOneType.isModified 
-------------------------

                 Key: HHH-3730
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3730
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.3.1, 3.3.0.SP1, 3.3.0.GA, 3.3.0.CR2, 3.3.0.CR1
            Reporter: Riccardo Mirasola
            Priority: Minor


public class ManyToOneType extends EntityType {
.....	
                                         public boolean isModified(
			Object old,
			Object current,
			boolean[] checkable,
			SessionImplementor session) throws HibernateException {
		if ( current == null ) {
			return old!=null;
		}
		if ( old == null ) {
			// we already know current is not null...
			return true;
		}
		// the ids are fully resolved, so compare them with isDirty(), not isModified()
		return getIdentifierOrUniqueKeyType( session.getFactory() )
				.isDirty( old, getIdentifier( current, session ), session );
	}
....
}

When using findModified method on the EntityPersister  all no null many-to-one properties is returned as modified because the isDirty is called with old that is the object instance (ie. not the identifier) and  for current the identifier is resolved. Last line should be 

		return getIdentifierOrUniqueKeyType( session.getFactory() )
				.isDirty( getIdentifier( old, session ), getIdentifier( current, session ), session );







-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list