mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-18 09:05:21 +00:00
HHH-17173 Getting one-to-one association through a referenece to a bytecode enchanced entity fails
This commit is contained in:
parent
e657efbdc5
commit
4bfa3853c9
@ -98,7 +98,6 @@ protected void resolveKey(
|
||||
else {
|
||||
entityKey = new EntityKey( entityIdentifier, concreteDescriptor );
|
||||
state = State.KEY_RESOLVED;
|
||||
registerResolutionListener();
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,6 +116,17 @@ protected Object getExistingInitializedInstance(RowProcessingState rowProcessing
|
||||
else if ( isInitialized( instance ) ) {
|
||||
return instance;
|
||||
}
|
||||
else {
|
||||
// the instance is not initialized but there is another initialzier that is loading it
|
||||
final LoadingEntityEntry loadingEntityEntry = persistenceContext
|
||||
.getLoadContexts().findLoadingEntityEntry( entityKey );
|
||||
if ( loadingEntityEntry != null ) {
|
||||
return loadingEntityEntry.getEntityInstance();
|
||||
}
|
||||
}
|
||||
// we need to register a resolution listener only if there is not an already initialized instance
|
||||
// or an instance that another initialzier is loading
|
||||
registerResolutionListener();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user