File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
hibernate-core/src/main/java/org/hibernate/engine/internal Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -383,7 +383,9 @@ public Object[] getCachedDatabaseSnapshot(EntityKey key) {
383
383
@ Override
384
384
public void addEntity (EntityKey key , Object entity ) {
385
385
entitiesByKey .put ( key , entity );
386
- getBatchFetchQueue ().removeBatchLoadableEntityKey ( key );
386
+ if ( batchFetchQueue != null ) {
387
+ getBatchFetchQueue ().removeBatchLoadableEntityKey (key );
388
+ }
387
389
}
388
390
389
391
@ Override
@@ -409,8 +411,10 @@ public Object removeEntity(EntityKey key) {
409
411
parentsByChild .clear ();
410
412
entitySnapshotsByKey .remove ( key );
411
413
nullifiableEntityKeys .remove ( key );
412
- getBatchFetchQueue ().removeBatchLoadableEntityKey ( key );
413
- getBatchFetchQueue ().removeSubselect ( key );
414
+ if ( batchFetchQueue != null ) {
415
+ getBatchFetchQueue ().removeBatchLoadableEntityKey (key );
416
+ getBatchFetchQueue ().removeSubselect (key );
417
+ }
414
418
return entity ;
415
419
}
416
420
You can’t perform that action at this time.
0 commit comments