Fix in-array predicate rendering for cockroachdb
This commit is contained in:
parent
203f28e14c
commit
f7eb58341e
|
@ -15,6 +15,7 @@ import org.hibernate.sql.ast.tree.expression.Expression;
|
||||||
import org.hibernate.sql.ast.tree.expression.Literal;
|
import org.hibernate.sql.ast.tree.expression.Literal;
|
||||||
import org.hibernate.sql.ast.tree.expression.Summarization;
|
import org.hibernate.sql.ast.tree.expression.Summarization;
|
||||||
import org.hibernate.sql.ast.tree.predicate.BooleanExpressionPredicate;
|
import org.hibernate.sql.ast.tree.predicate.BooleanExpressionPredicate;
|
||||||
|
import org.hibernate.sql.ast.tree.predicate.InArrayPredicate;
|
||||||
import org.hibernate.sql.ast.tree.predicate.LikePredicate;
|
import org.hibernate.sql.ast.tree.predicate.LikePredicate;
|
||||||
import org.hibernate.sql.ast.tree.select.QueryGroup;
|
import org.hibernate.sql.ast.tree.select.QueryGroup;
|
||||||
import org.hibernate.sql.ast.tree.select.QueryPart;
|
import org.hibernate.sql.ast.tree.select.QueryPart;
|
||||||
|
@ -183,4 +184,12 @@ public class CockroachLegacySqlAstTranslator<T extends JdbcOperation> extends Ab
|
||||||
protected boolean supportsRowValueConstructorSyntaxInQuantifiedPredicates() {
|
protected boolean supportsRowValueConstructorSyntaxInQuantifiedPredicates() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void visitInArrayPredicate(InArrayPredicate inArrayPredicate) {
|
||||||
|
inArrayPredicate.getTestExpression().accept( this );
|
||||||
|
appendSql( " = ANY(" );
|
||||||
|
inArrayPredicate.getArrayParameter().accept( this );
|
||||||
|
appendSql( ')' );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ import org.hibernate.sql.ast.tree.expression.Expression;
|
||||||
import org.hibernate.sql.ast.tree.expression.Literal;
|
import org.hibernate.sql.ast.tree.expression.Literal;
|
||||||
import org.hibernate.sql.ast.tree.expression.Summarization;
|
import org.hibernate.sql.ast.tree.expression.Summarization;
|
||||||
import org.hibernate.sql.ast.tree.predicate.BooleanExpressionPredicate;
|
import org.hibernate.sql.ast.tree.predicate.BooleanExpressionPredicate;
|
||||||
|
import org.hibernate.sql.ast.tree.predicate.InArrayPredicate;
|
||||||
import org.hibernate.sql.ast.tree.predicate.LikePredicate;
|
import org.hibernate.sql.ast.tree.predicate.LikePredicate;
|
||||||
import org.hibernate.sql.ast.tree.select.QueryGroup;
|
import org.hibernate.sql.ast.tree.select.QueryGroup;
|
||||||
import org.hibernate.sql.ast.tree.select.QueryPart;
|
import org.hibernate.sql.ast.tree.select.QueryPart;
|
||||||
|
@ -155,4 +156,12 @@ public class CockroachSqlAstTranslator<T extends JdbcOperation> extends Abstract
|
||||||
protected boolean supportsRowValueConstructorSyntaxInQuantifiedPredicates() {
|
protected boolean supportsRowValueConstructorSyntaxInQuantifiedPredicates() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void visitInArrayPredicate(InArrayPredicate inArrayPredicate) {
|
||||||
|
inArrayPredicate.getTestExpression().accept( this );
|
||||||
|
appendSql( " = ANY(" );
|
||||||
|
inArrayPredicate.getArrayParameter().accept( this );
|
||||||
|
appendSql( ')' );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue