diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/OracleSqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/dialect/OracleSqlAstTranslator.java index b26ef39f0f..0055835855 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/OracleSqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/OracleSqlAstTranslator.java @@ -612,21 +612,11 @@ public class OracleSqlAstTranslator extends SqlAstTrans return false; } - @Override - protected boolean supportsRowValueConstructorSyntaxInInList() { - return true; - } - @Override protected boolean supportsRowValueConstructorSyntaxInQuantifiedPredicates() { return false; } - @Override - protected boolean supportsRowValueConstructorSyntaxInInSubQuery() { - return true; - } - @Override protected String getDual() { return "dual"; diff --git a/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java b/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java index 8316409c50..d91c94c546 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/ast/spi/AbstractSqlAstTranslator.java @@ -8320,14 +8320,14 @@ public abstract class AbstractSqlAstTranslator implemen else if ( needsTupleComparisonEmulation( operator ) ) { rhsTuple = SqlTupleContainer.getSqlTuple( rhsExpression ); assert rhsTuple != null; - // Some DBs like Oracle support tuples only for the IN subquery predicate - if ( ( operator == ComparisonOperator.EQUAL || operator == ComparisonOperator.NOT_EQUAL ) && supportsRowValueConstructorSyntaxInInSubQuery() ) { + // If the DB supports tuples in the IN list predicate, use that syntax as it's more concise + if ( ( operator == ComparisonOperator.EQUAL || operator == ComparisonOperator.NOT_EQUAL ) && supportsRowValueConstructorSyntaxInInList() ) { comparisonPredicate.getLeftHandExpression().accept( this ); if ( operator == ComparisonOperator.NOT_EQUAL ) { appendSql( " not" ); } appendSql( " in (" ); - renderExpressionsAsSubquery( rhsTuple.getExpressions() ); + rhsTuple.accept( this ); appendSql( CLOSE_PARENTHESIS ); } else {