use of net.sf.jsqlparser.expression.BinaryExpression in project herddb by diennea.
the class SQLPlanner method findConstraintExpressionOnColumn.
private Expression findConstraintExpressionOnColumn(Expression where, String columnName, String tableAlias, Class<? extends BinaryExpression> expressionType) throws StatementExecutionException {
if (where instanceof AndExpression) {
AndExpression and = (AndExpression) where;
Expression keyOnLeft = findConstraintExpressionOnColumn(and.getLeftExpression(), columnName, tableAlias, expressionType);
if (keyOnLeft != null) {
return keyOnLeft;
}
Expression keyOnRight = findConstraintExpressionOnColumn(and.getRightExpression(), columnName, tableAlias, expressionType);
if (keyOnRight != null) {
return keyOnRight;
}
} else if (expressionType.isAssignableFrom(where.getClass())) {
Expression keyDirect = validateColumnConstaintExpressionToExpression(where, columnName, tableAlias, expressionType);
if (keyDirect != null) {
return keyDirect;
}
}
return null;
}
use of net.sf.jsqlparser.expression.BinaryExpression in project herddb by diennea.
the class SQLPlanner method findConstraintOnColumn.
private static Expression findConstraintOnColumn(Expression where, String columnName, String tableAlias, Class<? extends BinaryExpression> expressionType) throws StatementExecutionException {
if (where instanceof AndExpression) {
AndExpression and = (AndExpression) where;
Expression keyOnLeft = findConstraintOnColumn(and.getLeftExpression(), columnName, tableAlias, expressionType);
if (keyOnLeft != null) {
return keyOnLeft;
}
Expression keyOnRight = findConstraintOnColumn(and.getRightExpression(), columnName, tableAlias, expressionType);
if (keyOnRight != null) {
return keyOnRight;
}
} else if (expressionType.isAssignableFrom(where.getClass())) {
Expression keyDirect = validateColumnConstaintToExpression(where, columnName, tableAlias, expressionType);
if (keyDirect != null) {
return keyDirect;
}
}
return null;
}
Aggregations