Search in sources :

Example 6 with BooleanExpression

use of javax.jdo.query.BooleanExpression in project datanucleus-api-jdo by datanucleus.

the class ComparableExpressionImpl method gteq.

/* (non-Javadoc)
     * @see org.datanucleus.query.typesafe.Expression#gteq(org.datanucleus.query.typesafe.ComparableExpression)
     */
public BooleanExpression gteq(ComparableExpression expr) {
    Expression leftQueryExpr = queryExpr;
    Expression rightQueryExpr = ((ExpressionImpl) expr).getQueryExpression();
    org.datanucleus.query.expression.Expression queryExpr = new DyadicExpression(leftQueryExpr, org.datanucleus.query.expression.Expression.OP_GTEQ, rightQueryExpr);
    return new BooleanExpressionImpl(queryExpr);
}
Also used : DyadicExpression(org.datanucleus.query.expression.DyadicExpression) NumericExpression(javax.jdo.query.NumericExpression) ComparableExpression(javax.jdo.query.ComparableExpression) Expression(org.datanucleus.query.expression.Expression) InvokeExpression(org.datanucleus.query.expression.InvokeExpression) OrderExpression(javax.jdo.query.OrderExpression) PersistableExpression(javax.jdo.query.PersistableExpression) BooleanExpression(javax.jdo.query.BooleanExpression) Expression(org.datanucleus.query.expression.Expression) DyadicExpression(org.datanucleus.query.expression.DyadicExpression)

Example 7 with BooleanExpression

use of javax.jdo.query.BooleanExpression in project datanucleus-api-jdo by datanucleus.

the class StringExpressionImpl method matches.

public BooleanExpression matches(String str) {
    List<org.datanucleus.query.expression.Expression> args = new ArrayList();
    args.add(new Literal(str));
    org.datanucleus.query.expression.Expression invokeExpr = new InvokeExpression(queryExpr, "matches", args);
    return new BooleanExpressionImpl(invokeExpr);
}
Also used : InvokeExpression(org.datanucleus.query.expression.InvokeExpression) DyadicExpression(org.datanucleus.query.expression.DyadicExpression) NumericExpression(javax.jdo.query.NumericExpression) CharacterExpression(javax.jdo.query.CharacterExpression) InvokeExpression(org.datanucleus.query.expression.InvokeExpression) StringExpression(javax.jdo.query.StringExpression) PersistableExpression(javax.jdo.query.PersistableExpression) BooleanExpression(javax.jdo.query.BooleanExpression) Expression(javax.jdo.query.Expression) Literal(org.datanucleus.query.expression.Literal) ArrayList(java.util.ArrayList)

Example 8 with BooleanExpression

use of javax.jdo.query.BooleanExpression in project datanucleus-api-jdo by datanucleus.

the class StringExpressionImpl method endsWith.

/* (non-Javadoc)
     * @see org.datanucleus.query.typesafe.StringExpression#endsWith(java.lang.String)
     */
public BooleanExpression endsWith(String str) {
    List<org.datanucleus.query.expression.Expression> args = new ArrayList();
    args.add(new Literal(str));
    org.datanucleus.query.expression.Expression invokeExpr = new InvokeExpression(queryExpr, "endsWith", args);
    return new BooleanExpressionImpl(invokeExpr);
}
Also used : InvokeExpression(org.datanucleus.query.expression.InvokeExpression) DyadicExpression(org.datanucleus.query.expression.DyadicExpression) NumericExpression(javax.jdo.query.NumericExpression) CharacterExpression(javax.jdo.query.CharacterExpression) InvokeExpression(org.datanucleus.query.expression.InvokeExpression) StringExpression(javax.jdo.query.StringExpression) PersistableExpression(javax.jdo.query.PersistableExpression) BooleanExpression(javax.jdo.query.BooleanExpression) Expression(javax.jdo.query.Expression) Literal(org.datanucleus.query.expression.Literal) ArrayList(java.util.ArrayList)

Example 9 with BooleanExpression

use of javax.jdo.query.BooleanExpression in project datanucleus-api-jdo by datanucleus.

the class BooleanExpressionImpl method not.

/* (non-Javadoc)
     * @see org.datanucleus.query.typesafe.BooleanExpression#not()
     */
public BooleanExpression not() {
    Expression rightQueryExpr = queryExpr;
    org.datanucleus.query.expression.Expression queryExpr = new DyadicExpression(org.datanucleus.query.expression.Expression.OP_NOT, rightQueryExpr);
    return new BooleanExpressionImpl(queryExpr);
}
Also used : DyadicExpression(org.datanucleus.query.expression.DyadicExpression) Expression(org.datanucleus.query.expression.Expression) PersistableExpression(javax.jdo.query.PersistableExpression) BooleanExpression(javax.jdo.query.BooleanExpression) Expression(org.datanucleus.query.expression.Expression) DyadicExpression(org.datanucleus.query.expression.DyadicExpression)

Example 10 with BooleanExpression

use of javax.jdo.query.BooleanExpression in project datanucleus-api-jdo by datanucleus.

the class CollectionExpressionImpl method contains.

/* (non-Javadoc)
     * @see org.datanucleus.query.typesafe.CollectionExpression#contains(java.lang.Object)
     */
public BooleanExpression contains(E elem) {
    List<org.datanucleus.query.expression.Expression> args = new ArrayList();
    args.add(new Literal(elem));
    org.datanucleus.query.expression.Expression invokeExpr = new InvokeExpression(queryExpr, "contains", args);
    return new BooleanExpressionImpl(invokeExpr);
}
Also used : InvokeExpression(org.datanucleus.query.expression.InvokeExpression) CollectionExpression(javax.jdo.query.CollectionExpression) NumericExpression(javax.jdo.query.NumericExpression) InvokeExpression(org.datanucleus.query.expression.InvokeExpression) PersistableExpression(javax.jdo.query.PersistableExpression) BooleanExpression(javax.jdo.query.BooleanExpression) Expression(javax.jdo.query.Expression) Literal(org.datanucleus.query.expression.Literal) ArrayList(java.util.ArrayList)

Aggregations

BooleanExpression (javax.jdo.query.BooleanExpression)19 PersistableExpression (javax.jdo.query.PersistableExpression)19 NumericExpression (javax.jdo.query.NumericExpression)16 InvokeExpression (org.datanucleus.query.expression.InvokeExpression)16 DyadicExpression (org.datanucleus.query.expression.DyadicExpression)15 Literal (org.datanucleus.query.expression.Literal)12 Expression (org.datanucleus.query.expression.Expression)11 ArrayList (java.util.ArrayList)8 ComparableExpression (javax.jdo.query.ComparableExpression)8 Expression (javax.jdo.query.Expression)8 OrderExpression (javax.jdo.query.OrderExpression)8 CharacterExpression (javax.jdo.query.CharacterExpression)4 StringExpression (javax.jdo.query.StringExpression)4 MapExpression (javax.jdo.query.MapExpression)3 CollectionExpression (javax.jdo.query.CollectionExpression)1