net.sf.jsqlparser.expression.operators.relational.EqualsTo Java Examples

The following examples show how to use net.sf.jsqlparser.expression.operators.relational.EqualsTo. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ObjectIdFunction.java    From sql-to-mongo-db-query-converter with Apache License 2.0 6 votes vote down vote up
public Object toDocument() throws ParseException {
    if (EqualsTo.class.isInstance(comparisonExpression)) {
        return new ObjectId(value.toString());
    } else if (NotEqualsTo.class.isInstance(comparisonExpression)) {
        return new Document("$ne", new ObjectId(value.toString()));
    } else if (InExpression.class.isInstance(comparisonExpression)) {
        InExpression inExpression = (InExpression) comparisonExpression;
        List<String> stringList = (List<String>) value;
        return new Document(inExpression.isNot() ? "$nin" : "$in", Lists.transform(stringList, new Function<String, ObjectId>() {
            @Override public ObjectId apply(String s) {
                return new ObjectId(s);
            }
        }));
    }
    throw new ParseException("Count not convert ObjectId function into document");
}
 
Example #2
Source File: EqualExpressionConverter.java    From sqlhelper with GNU Lesser General Public License v3.0 5 votes vote down vote up
public EqualExpressionConverter() {
    setJsqlparserExpressionSupplier(new Supplier<EqualExpression, EqualsTo>() {
        @Override
        public EqualsTo get(EqualExpression input) {
            return new EqualsTo();
        }
    });
}
 
Example #3
Source File: EqualExpressionConverter.java    From sqlhelper with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public Class<EqualsTo> getJSqlParserExpressionClass() {
    return EqualsTo.class;
}
 
Example #4
Source File: ExpressionVisitorImpl.java    From DataPermissionHelper with Apache License 2.0 4 votes vote down vote up
@Override
public void visit(EqualsTo equalsTo) {
    visitBinaryExpression(equalsTo);
}
 
Example #5
Source File: DMLWhereClauseVisitor.java    From spanner-jdbc with MIT License 4 votes vote down vote up
@Override
public void visit(EqualsTo expr) {
  // If it is an NOT ID=1, then it's not a valid equals clause
  foundEquals = !expr.isNot();
  super.visit(expr);
}
 
Example #6
Source File: CTEToNestedQueryConverter.java    From quetzal with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void visit(EqualsTo equalsTo) {
	visitBinary(equalsTo, true);
	
}