Skip to content

Commit 6dbbbc3

Browse files
committed
HHH-19260 - Move supportsNestedWithClause() to Dialect
Signed-off-by: Jan Schatteman <[email protected]>
1 parent 3483a48 commit 6dbbbc3

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/FirebirdDialect.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,4 +1130,9 @@ public boolean supportsRowValueConstructorSyntax() {
11301130
return false;
11311131
}
11321132

1133+
@Override
1134+
public boolean supportsNestedWithClause() {
1135+
return false;
1136+
}
1137+
11331138
}

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/FirebirdSqlAstTranslator.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,6 @@ private boolean supportsOffsetFetchClause() {
252252
return getDialect().getVersion().isSameOrAfter( 3 );
253253
}
254254

255-
@Override
256-
protected boolean supportsNestedWithClause() {
257-
return false;
258-
}
259-
260255
@Override
261256
public void visitSelfRenderingPredicate(SelfRenderingPredicate selfRenderingPredicate) {
262257
// see comments in visitParameter

hibernate-core/src/main/java/org/hibernate/dialect/Dialect.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6013,4 +6013,11 @@ public boolean supportsWithClauseInSubquery() {
60136013
return supportsWithClause();
60146014
}
60156015

6016+
/**
6017+
* Whether the SQL with clause is supported within a CTE.
6018+
*/
6019+
public boolean supportsNestedWithClause() {
6020+
return supportsWithClauseInSubquery();
6021+
}
6022+
60166023
}

hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,7 +2145,7 @@ public void visitCteContainer(CteContainer cteContainer) {
21452145
pushToTopLevel = false;
21462146
}
21472147
else {
2148-
pushToTopLevel = !supportsNestedWithClause()
2148+
pushToTopLevel = !dialect.supportsNestedWithClause()
21492149
|| !dialect.supportsWithClauseInSubquery() && isInSubquery();
21502150
}
21512151
final boolean inNestedWithClause = clauseStack.findCurrentFirst( AbstractSqlAstTranslator::matchWithClause ) != null;
@@ -2414,13 +2414,6 @@ protected void visitCteDefinition(CteStatement cte) {
24142414
limit = oldLimit;
24152415
}
24162416

2417-
/**
2418-
* Whether the SQL with clause is supported within a CTE.
2419-
*/
2420-
protected boolean supportsNestedWithClause() {
2421-
return dialect.supportsWithClauseInSubquery();
2422-
}
2423-
24242417
/**
24252418
* Whether CTEs should be inlined rather than rendered as CTEs.
24262419
*/

0 commit comments

Comments
 (0)