Search in sources :

Example 21 with DyadicExpression

use of org.datanucleus.query.expression.DyadicExpression in project datanucleus-api-jdo by datanucleus.

the class ComparableExpressionImpl method lt.

/* (non-Javadoc)
     * @see org.datanucleus.query.typesafe.Expression#lt(org.datanucleus.query.typesafe.ComparableExpression)
     */
public BooleanExpression lt(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_LT, 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 22 with DyadicExpression

use of org.datanucleus.query.expression.DyadicExpression in project datanucleus-api-jdo by datanucleus.

the class ComparableExpressionImpl method lteq.

/* (non-Javadoc)
     * @see org.datanucleus.query.typesafe.Expression#lteq(java.lang.Object)
     */
public BooleanExpression lteq(T t) {
    Expression leftQueryExpr = queryExpr;
    Expression rightQueryExpr = new Literal(t);
    org.datanucleus.query.expression.Expression queryExpr = new DyadicExpression(leftQueryExpr, org.datanucleus.query.expression.Expression.OP_LTEQ, 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) Literal(org.datanucleus.query.expression.Literal) Expression(org.datanucleus.query.expression.Expression) DyadicExpression(org.datanucleus.query.expression.DyadicExpression)

Example 23 with DyadicExpression

use of org.datanucleus.query.expression.DyadicExpression 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 24 with DyadicExpression

use of org.datanucleus.query.expression.DyadicExpression in project datanucleus-api-jdo by datanucleus.

the class ExpressionImpl method ne.

/* (non-Javadoc)
     * @see org.datanucleus.query.typesafe.Expression#ne(java.lang.Object)
     */
public BooleanExpression ne(T t) {
    org.datanucleus.query.expression.Expression leftQueryExpr = queryExpr;
    org.datanucleus.query.expression.Expression rightQueryExpr = new Literal(t);
    return new BooleanExpressionImpl(new DyadicExpression(leftQueryExpr, org.datanucleus.query.expression.Expression.OP_NOTEQ, rightQueryExpr));
}
Also used : Literal(org.datanucleus.query.expression.Literal) DyadicExpression(org.datanucleus.query.expression.DyadicExpression)

Example 25 with DyadicExpression

use of org.datanucleus.query.expression.DyadicExpression in project datanucleus-api-jdo by datanucleus.

the class ExpressionImpl method ne.

/* (non-Javadoc)
     * @see org.datanucleus.query.typesafe.Expression#ne(org.datanucleus.query.typesafe.Expression)
     */
public BooleanExpression ne(Expression expr) {
    if (expr == null) {
        // Assume they meant to compare with NULL Literal
        return this.ne((T) null);
    }
    org.datanucleus.query.expression.Expression leftQueryExpr = queryExpr;
    org.datanucleus.query.expression.Expression rightQueryExpr = ((ExpressionImpl) expr).getQueryExpression();
    return new BooleanExpressionImpl(new DyadicExpression(leftQueryExpr, org.datanucleus.query.expression.Expression.OP_NOTEQ, rightQueryExpr));
}
Also used : DyadicExpression(org.datanucleus.query.expression.DyadicExpression)

Aggregations

DyadicExpression (org.datanucleus.query.expression.DyadicExpression)51 InvokeExpression (org.datanucleus.query.expression.InvokeExpression)43 Expression (org.datanucleus.query.expression.Expression)42 PrimaryExpression (org.datanucleus.query.expression.PrimaryExpression)36 ParameterExpression (org.datanucleus.query.expression.ParameterExpression)34 Literal (org.datanucleus.query.expression.Literal)32 VariableExpression (org.datanucleus.query.expression.VariableExpression)30 NucleusException (org.datanucleus.exceptions.NucleusException)21 QueryCompilation (org.datanucleus.query.compiler.QueryCompilation)20 JavaQueryCompiler (org.datanucleus.query.compiler.JavaQueryCompiler)18 OrderExpression (org.datanucleus.query.expression.OrderExpression)13 BooleanExpression (javax.jdo.query.BooleanExpression)12 PersistableExpression (javax.jdo.query.PersistableExpression)12 JDOQLCompiler (org.datanucleus.query.compiler.JDOQLCompiler)12 Product (org.datanucleus.samples.store.Product)12 HashMap (java.util.HashMap)11 NumericExpression (javax.jdo.query.NumericExpression)9 ComparableExpression (javax.jdo.query.ComparableExpression)8 OrderExpression (javax.jdo.query.OrderExpression)8 NucleusUserException (org.datanucleus.exceptions.NucleusUserException)7