Skip to content

Commit 94acfa3

Browse files
committed
HHH-19368 Account for single-table inheritance subqueries in EVPs
1 parent 2e6b568 commit 94acfa3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hibernate-core/src/main/java/org/hibernate/query/sqm/sql/internal/EntityValuedPathInterpretation.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,9 @@ private static boolean supportsFunctionalDependency(Dialect dialect, EntityMappi
407407
final FunctionalDependencyAnalysisSupport analysisSupport = dialect.getFunctionalDependencyAnalysisSupport();
408408
if ( analysisSupport.supportsAnalysis() ) {
409409
if ( entityMappingType.getSqmMultiTableMutationStrategy() == null ) {
410-
return true;
410+
// A subquery may be used to render a single-table inheritance subtype, in which case
411+
// we cannot use functional dependency analysis unless the dialect supports table groups
412+
return analysisSupport.supportsTableGroups() || entityMappingType.getSuperMappingType() == null;
411413
}
412414
else {
413415
return analysisSupport.supportsTableGroups() && ( analysisSupport.supportsConstants() ||

0 commit comments

Comments
 (0)