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

The following examples show how to use net.sf.jsqlparser.expression.operators.relational.EqualsTo. These examples are extracted from open source projects. 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
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
public EqualExpressionConverter() {
    setJsqlparserExpressionSupplier(new Supplier<EqualExpression, EqualsTo>() {
        @Override
        public EqualsTo get(EqualExpression input) {
            return new EqualsTo();
        }
    });
}
 
Example 3
@Override
public Class<EqualsTo> getJSqlParserExpressionClass() {
    return EqualsTo.class;
}
 
Example 4
@Override
public void visit(EqualsTo equalsTo) {
    visitBinaryExpression(equalsTo);
}
 
Example 5
Source Project: spanner-jdbc   Source File: DMLWhereClauseVisitor.java    License: 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 Project: quetzal   Source File: CTEToNestedQueryConverter.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void visit(EqualsTo equalsTo) {
	visitBinary(equalsTo, true);
	
}