HHH-7253 NPE thrown by NaturalIdResolutionCache

This commit is contained in:
Strong Liu 2012-04-17 11:18:36 +08:00
parent 5671de517d
commit a67c1afe10
1 changed files with 6 additions and 0 deletions

View File

@ -441,6 +441,9 @@ public class NaturalIdXrefDelegate {
}
public boolean sameAsCached(Serializable pk, Object[] naturalIdValues) {
if ( pk == null ) {
return false;
}
final CachedNaturalId initial = pkToNaturalIdMap.get( pk );
if ( initial != null ) {
if ( initial.isSame( naturalIdValues ) ) {
@ -451,6 +454,9 @@ public class NaturalIdXrefDelegate {
}
public boolean cache(Serializable pk, Object[] naturalIdValues) {
if ( pk == null ) {
return false;
}
final CachedNaturalId initial = pkToNaturalIdMap.get( pk );
if ( initial != null ) {
if ( initial.isSame( naturalIdValues ) ) {