File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
hibernate-core/src/main/java/org/hibernate/sql/ast/spi Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -7664,7 +7664,24 @@ public void visitInListPredicate(InListPredicate inListPredicate) {
76647664 }
76657665 else if ( !dialect .supportsRowValueConstructorSyntaxInInList () ) {
76667666 // Some DBs like Oracle support tuples only for the IN subquery predicate
7667- if ( dialect .supportsRowValueConstructorSyntaxInInSubQuery () && dialect .supportsUnionAll () ) {
7667+ if ( dialect .supportsRowValueConstructorSyntaxInInSubQuery () && dialect .supportsValuesList () ) {
7668+ inListPredicate .getTestExpression ().accept ( this );
7669+ if ( inListPredicate .isNegated () ) {
7670+ appendSql ( " not" );
7671+ }
7672+ appendSql ( " in (select * from (values" );
7673+ char separator = ' ' ;
7674+ for ( Expression expression : listExpressions ) {
7675+ appendSql ( separator );
7676+ appendSql ( OPEN_PARENTHESIS );
7677+ renderCommaSeparated ( getSqlTuple ( expression ).getExpressions () );
7678+ appendSql ( CLOSE_PARENTHESIS );
7679+ separator = ',' ;
7680+ }
7681+ appendSql ( CLOSE_PARENTHESIS );
7682+ appendSql ( CLOSE_PARENTHESIS );
7683+ }
7684+ else if ( dialect .supportsRowValueConstructorSyntaxInInSubQuery () && dialect .supportsUnionAll () ) {
76687685 inListPredicate .getTestExpression ().accept ( this );
76697686 if ( inListPredicate .isNegated () ) {
76707687 appendSql ( " not" );
You can’t perform that action at this time.
0 commit comments