Search in sources :

Example 1 with StringExpression

use of javax.jdo.query.StringExpression 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)

Example 2 with StringExpression

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

the class StringExpressionImpl method substring.

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

ArrayList (java.util.ArrayList)2 BooleanExpression (javax.jdo.query.BooleanExpression)2 CharacterExpression (javax.jdo.query.CharacterExpression)2 Expression (javax.jdo.query.Expression)2 NumericExpression (javax.jdo.query.NumericExpression)2 PersistableExpression (javax.jdo.query.PersistableExpression)2 StringExpression (javax.jdo.query.StringExpression)2 DyadicExpression (org.datanucleus.query.expression.DyadicExpression)2 InvokeExpression (org.datanucleus.query.expression.InvokeExpression)2 Literal (org.datanucleus.query.expression.Literal)2