HHH-7829 NullPointerException when manually flushing One-To-One

relationship with orphan removal
This commit is contained in:
Brett Meyer 2013-02-01 12:59:39 -05:00
parent 1dca45f06f
commit 17e8bbc6b7
1 changed files with 10 additions and 6 deletions

View File

@ -256,6 +256,9 @@ public final class Cascade {
final EntityEntry valueEntry = eventSource
.getPersistenceContext().getEntry(
loadedValue );
// Need to check this in case the context has
// already been flushed. See HHH-7829.
if ( valueEntry != null ) {
final String entityName = valueEntry.getPersister().getEntityName();
if ( LOG.isTraceEnabled() ) {
final Serializable id = valueEntry.getPersister().getIdentifier( loadedValue, eventSource );
@ -269,6 +272,7 @@ public final class Cascade {
}
}
}
}
/**
* Check if the association is a one to one in the logical model (either a shared-pk