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 Project: sql-to-mongo-db-query-converter   Author: vincentrussell   File: ObjectIdFunction.java    License: 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 Project: sqlhelper   Author: fangjinuo   File: EqualExpressionConverter.java    License: 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 Project: sqlhelper   Author: fangjinuo   File: EqualExpressionConverter.java    License: GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public Class<EqualsTo> getJSqlParserExpressionClass() {
    return EqualsTo.class;
}
 
Example #4
Source Project: DataPermissionHelper   Author: holyliao   File: ExpressionVisitorImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void visit(EqualsTo equalsTo) {
    visitBinaryExpression(equalsTo);
}
 
Example #5
Source Project: spanner-jdbc   Author: olavloite   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   Author: Quetzal-RDF   File: CTEToNestedQueryConverter.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void visit(EqualsTo equalsTo) {
	visitBinary(equalsTo, true);
	
}