Aman Gupta commented on Bug HHH-7496

I checked the source code and found the piece of code which is causing the issue:

1) DefaultFlushEntityEventListener:
private void checkNaturalId(
EntityPersister persister,
EntityEntry entry,
Object[] current,
Object[] loaded,
EntityMode entityMode,
SessionImplementor session){
//piece of code
if ( !persister.getIdentifierType().isEqual( id, oid, entityMode, session.getFactory() ) ) { throw new HibernateException( "identifier of an instance of " + persister.getEntityName() + " was altered from " + id + " to " + oid ); }

2) public final class EqualsHelper {

public static boolean equals(Object x, Object y) { return x==y || ( x!=null && y!=null && x.equals(y) ); }

private EqualsHelper() {}

}

Here we don't trim the values which is causing the issue.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira