Skip to content

Commit 8ffb023

Browse files
committed
HHH-19368 Account for single-table inheritance subqueries in EVPs
1 parent 19b4eaf commit 8ffb023

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
@@ -402,7 +402,9 @@ private static boolean supportsFunctionalDependency(Dialect dialect, EntityMappi
402402
final FunctionalDependencyAnalysisSupport analysisSupport = dialect.getFunctionalDependencyAnalysisSupport();
403403
if ( analysisSupport.supportsAnalysis() ) {
404404
if ( entityMappingType.getSqmMultiTableMutationStrategy() == null ) {
405-
return true;
405+
// A subquery may be used to render a single-table inheritance subtype, in which case
406+
// we cannot use functional dependency analysis unless the dialect supports table groups
407+
return analysisSupport.supportsTableGroups() || entityMappingType.getSuperMappingType() == null;
406408
}
407409
else {
408410
return analysisSupport.supportsTableGroups() && ( analysisSupport.supportsConstants() ||

0 commit comments

Comments
 (0)