Skip to content

Commit d24a920

Browse files
committed
HHH-19260 - Move supportsRowValueConstructorGtLtSyntax() to Dialect
Signed-off-by: Jan Schatteman <[email protected]>
1 parent c00c0f9 commit d24a920

File tree

6 files changed

+28
-26
lines changed

6 files changed

+28
-26
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,4 +2018,10 @@ public String getDual() {
20182018
public String getFromDualForSelectOnly() {
20192019
return " from " + getDual();
20202020
}
2021+
2022+
@Override
2023+
public boolean supportsRowValueConstructorGtLtSyntax() {
2024+
return false;
2025+
}
2026+
20212027
}

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,6 @@ protected boolean supportsRowValueConstructorSyntaxInQuantifiedPredicates() {
317317
return false;
318318
}
319319

320-
@Override
321-
protected boolean supportsRowValueConstructorGtLtSyntax() {
322-
return false;
323-
}
324-
325320
@Override
326321
protected void renderInsertIntoNoColumns(TableInsertStandard tableInsert) {
327322
throw new MappingException(

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5969,4 +5969,19 @@ public boolean supportsRowValueConstructorSyntax() {
59695969
return true;
59705970
}
59715971

5972+
/**
5973+
* Is this dialect known to support what ANSI-SQL terms "row value
5974+
* constructor" syntax; sometimes called tuple syntax with <code>&lt;</code>, <code>&gt;</code>, <code>&le;</code>
5975+
* and <code>&ge;</code> operators.
5976+
* <p>
5977+
* Basically, does it support syntax like
5978+
* {@code ... where (FIRST_NAME, LAST_NAME) &lt; ('Steve', 'Ebersole') ...}
5979+
*
5980+
* @return True if this SQL dialect is known to support "row value
5981+
* constructor" syntax with relational comparison operators; false otherwise.
5982+
*/
5983+
public boolean supportsRowValueConstructorGtLtSyntax() {
5984+
return supportsRowValueConstructorSyntax();
5985+
}
5986+
59725987
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,4 +2024,10 @@ public String getDual() {
20242024
public String getFromDualForSelectOnly() {
20252025
return " from " + getDual();
20262026
}
2027+
2028+
@Override
2029+
public boolean supportsRowValueConstructorGtLtSyntax() {
2030+
return false;
2031+
}
2032+
20272033
}

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,6 @@ protected boolean supportsRowValueConstructorSyntaxInQuantifiedPredicates() {
324324
return false;
325325
}
326326

327-
@Override
328-
protected boolean supportsRowValueConstructorGtLtSyntax() {
329-
return false;
330-
}
331-
332327
@Override
333328
protected void renderInsertIntoNoColumns(TableInsertStandard tableInsert) {
334329
throw new MappingException(

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

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8413,28 +8413,13 @@ private boolean needsTupleComparisonEmulation(ComparisonOperator operator) {
84138413
}
84148414
return switch (operator) {
84158415
case LESS_THAN, LESS_THAN_OR_EQUAL, GREATER_THAN, GREATER_THAN_OR_EQUAL ->
8416-
!supportsRowValueConstructorGtLtSyntax();
8416+
!dialect.supportsRowValueConstructorGtLtSyntax();
84178417
case DISTINCT_FROM, NOT_DISTINCT_FROM ->
84188418
!supportsRowValueConstructorDistinctFromSyntax();
84198419
default -> false;
84208420
};
84218421
}
84228422

8423-
/**
8424-
* Is this dialect known to support what ANSI-SQL terms "row value
8425-
* constructor" syntax; sometimes called tuple syntax with <code>&lt;</code>, <code>&gt;</code>, <code>&le;</code>
8426-
* and <code>&ge;</code> operators.
8427-
* <p>
8428-
* Basically, does it support syntax like
8429-
* {@code ... where (FIRST_NAME, LAST_NAME) &lt; ('Steve', 'Ebersole') ...}
8430-
*
8431-
* @return True if this SQL dialect is known to support "row value
8432-
* constructor" syntax with relational comparison operators; false otherwise.
8433-
*/
8434-
protected boolean supportsRowValueConstructorGtLtSyntax() {
8435-
return dialect.supportsRowValueConstructorSyntax();
8436-
}
8437-
84388423
/**
84398424
* Is this dialect known to support what ANSI-SQL terms "row value
84408425
* constructor" syntax; sometimes called tuple syntax with <code>is distinct from</code>

0 commit comments

Comments
 (0)