Search in sources :

Example 16 with BooleanExpression

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

the class BooleanExpressionImpl method or.

/* (non-Javadoc)
     * @see org.datanucleus.query.typesafe.BooleanExpression#or(org.datanucleus.query.typesafe.BooleanExpression)
     */
public BooleanExpression or(BooleanExpression expr) {
    Expression leftQueryExpr = queryExpr;
    Expression rightQueryExpr = ((ExpressionImpl) expr).getQueryExpression();
    org.datanucleus.query.expression.Expression queryExpr = new DyadicExpression(leftQueryExpr, org.datanucleus.query.expression.Expression.OP_OR, 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 17 with BooleanExpression

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

the class BooleanExpressionImpl method and.

/* (non-Javadoc)
     * @see org.datanucleus.query.typesafe.BooleanExpression#and(org.datanucleus.query.typesafe.BooleanExpression)
     */
public BooleanExpression and(BooleanExpression expr) {
    Expression leftQueryExpr = queryExpr;
    Expression rightQueryExpr = ((ExpressionImpl) expr).getQueryExpression();
    org.datanucleus.query.expression.Expression queryExpr = new DyadicExpression(leftQueryExpr, org.datanucleus.query.expression.Expression.OP_AND, 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 18 with BooleanExpression

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

the class StringExpressionImpl method startsWith.

/* (non-Javadoc)
     * @see org.datanucleus.query.typesafe.StringExpression#startsWith(java.lang.String)
     */
public BooleanExpression startsWith(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, "startsWith", 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 19 with BooleanExpression

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

the class StringExpressionImpl method equalsIgnoreCase.

/* (non-Javadoc)
     * @see org.datanucleus.query.typesafe.StringExpression#equalsIgnoreCase(java.lang.String)
     */
public BooleanExpression equalsIgnoreCase(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, "equalsIgnoreCase", 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)

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