HHH-11881 : Null Set collection elements are inserted into collection table

This commit is contained in:
Gail Badner 2017-07-20 16:48:56 -07:00
parent 240492f940
commit 3553efa05f
1 changed files with 2 additions and 2 deletions

View File

@ -384,7 +384,7 @@ public class PersistentSet extends AbstractPersistentCollection implements java.
// note that it might be better to iterate the snapshot but this is safe,
// assuming the user implements equals() properly, as required by the Set
// contract!
return oldValue == null || elemType.isDirty( oldValue, entry, getSession() );
return ( oldValue == null && entry != null ) || elemType.isDirty( oldValue, entry, getSession() );
}
@Override
@ -434,7 +434,7 @@ public class PersistentSet extends AbstractPersistentCollection implements java.
@Override
@SuppressWarnings("unchecked")
public boolean entryExists(Object key, int i) {
return true;
return key != null;
}
@Override