Skip to content

Commit 0725022

Browse files
committed
HHH-16966 StackOverFlowError with @manytoone and @Proxy( lazy=false )
1 parent 87096e5 commit 0725022

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

hibernate-core/src/main/java/org/hibernate/sql/results/graph/entity/internal/EntitySelectFetchInitializerBuilder.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,8 @@ else if ( creationState.isDynamicInstantiation() ) {
147147
}
148148

149149
private static boolean canBatchInitializeBeUsed(EntityPersister entityPersister) {
150-
if ( entityPersister.getRepresentationStrategy().getProxyFactory() == null
151-
&& entityPersister.hasSubclasses() ) {
152-
// We cannot neither create a proxy nor instantiate the entity because we don't know the concrete type
153-
return false;
154-
}
155-
return true;
150+
// we need to create a Proxy in order to use batch initialize
151+
return entityPersister.getRepresentationStrategy().getProxyFactory() != null;
156152
}
157153

158154
enum BatchMode {

0 commit comments

Comments
 (0)