Search in sources :

Example 26 with InvokeExpression

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

the class ComparableExpressionImpl method min.

/* (non-Javadoc)
     * @see org.datanucleus.query.typesafe.Expression#min()
     */
public NumericExpression min() {
    List<org.datanucleus.query.expression.Expression> args = new ArrayList();
    args.add(queryExpr);
    org.datanucleus.query.expression.Expression invokeExpr = new InvokeExpression(null, "min", args);
    return new NumericExpressionImpl<T>(invokeExpr);
}
Also used : InvokeExpression(org.datanucleus.query.expression.InvokeExpression) 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) ArrayList(java.util.ArrayList)

Example 27 with InvokeExpression

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

the class ListExpressionImpl method get.

/* (non-Javadoc)
     * @see org.datanucleus.query.typesafe.ListExpression#get(int)
     */
public Expression get(int pos) {
    List args = new ArrayList();
    args.add(new Literal(pos));
    org.datanucleus.query.expression.Expression invokeExpr = new InvokeExpression(queryExpr, "get", args);
    return new ExpressionImpl(invokeExpr);
}
Also used : InvokeExpression(org.datanucleus.query.expression.InvokeExpression) Literal(org.datanucleus.query.expression.Literal) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList)

Example 28 with InvokeExpression

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

the class ListExpressionImpl method get.

/* (non-Javadoc)
     * @see org.datanucleus.query.typesafe.ListExpression#get(org.datanucleus.query.typesafe.NumericExpression)
     */
public Expression get(NumericExpression<Integer> posExpr) {
    List args = new ArrayList();
    args.add(((ExpressionImpl) posExpr).getQueryExpression());
    org.datanucleus.query.expression.Expression invokeExpr = new InvokeExpression(queryExpr, "get", args);
    return new ExpressionImpl(invokeExpr);
}
Also used : InvokeExpression(org.datanucleus.query.expression.InvokeExpression) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList)

Example 29 with InvokeExpression

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

the class StringExpressionImpl method indexOf.

/* (non-Javadoc)
     * @see org.datanucleus.query.typesafe.StringExpression#indexOf(java.lang.String, org.datanucleus.query.typesafe.NumericExpression)
     */
public NumericExpression<Integer> indexOf(String str, NumericExpression pos) {
    List<org.datanucleus.query.expression.Expression> args = new ArrayList();
    args.add(new Literal(str));
    args.add(((ExpressionImpl) pos).getQueryExpression());
    org.datanucleus.query.expression.Expression invokeExpr = new InvokeExpression(queryExpr, "indexOf", args);
    return new NumericExpressionImpl<Integer>(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 30 with InvokeExpression

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

the class StringExpressionImpl method indexOf.

/* (non-Javadoc)
     * @see org.datanucleus.query.typesafe.StringExpression#indexOf(org.datanucleus.query.typesafe.StringExpression, int)
     */
public NumericExpression<Integer> indexOf(StringExpression expr, int pos) {
    List<org.datanucleus.query.expression.Expression> args = new ArrayList();
    args.add(((ExpressionImpl) expr).getQueryExpression());
    args.add(new Literal(pos));
    org.datanucleus.query.expression.Expression invokeExpr = new InvokeExpression(queryExpr, "indexOf", args);
    return new NumericExpressionImpl<Integer>(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

InvokeExpression (org.datanucleus.query.expression.InvokeExpression)65 Literal (org.datanucleus.query.expression.Literal)42 DyadicExpression (org.datanucleus.query.expression.DyadicExpression)40 Expression (org.datanucleus.query.expression.Expression)39 PrimaryExpression (org.datanucleus.query.expression.PrimaryExpression)38 ParameterExpression (org.datanucleus.query.expression.ParameterExpression)37 NucleusException (org.datanucleus.exceptions.NucleusException)32 ArrayList (java.util.ArrayList)25 VariableExpression (org.datanucleus.query.expression.VariableExpression)21 BooleanExpression (javax.jdo.query.BooleanExpression)17 NumericExpression (javax.jdo.query.NumericExpression)17 PersistableExpression (javax.jdo.query.PersistableExpression)17 Expression (javax.jdo.query.Expression)15 NucleusUserException (org.datanucleus.exceptions.NucleusUserException)13 OrderExpression (org.datanucleus.query.expression.OrderExpression)12 List (java.util.List)10 CharacterExpression (javax.jdo.query.CharacterExpression)10 StringExpression (javax.jdo.query.StringExpression)10 LocalDateTime (java.time.LocalDateTime)7 Calendar (java.util.Calendar)7