/** * @return An expression representing a non-null value. */ public Expression isNotNull() { return ExpressionFactory.matchExp(getExpression(), null).notExp(); }
/** * @see FunctionExpressionFactory#locateExp(String, Expression) */ public Property<Integer> locate(String string) { return create(FunctionExpressionFactory.locateExp(ExpressionFactory.wrapScalarValue(string), getExpression()), Integer.class); }
/** * @return An expression representing equality to FALSE. */ public Expression isFalse() { return ExpressionFactory.matchExp(getExpression(), Boolean.FALSE); }
/** * @return Represents a less than or equal relationship between two * attributes (columns). */ public Expression lte(Property<?> value) { return ExpressionFactory.lessOrEqualExp(getExpression(), value.getExpression()); }
/** * @return An expression representing inequality between two attributes * (columns). */ public Expression ne(Property<?> value) { return ExpressionFactory.noMatchExp(getExpression(), value.getExpression()); }
/** * @see FunctionExpressionFactory#sumExp(Expression) */ public Property<E> sum() { return create(FunctionExpressionFactory.sumExp(getExpression()), getType()); }
/** * @see FunctionExpressionFactory#maxExp(Expression) */ public Property<E> max() { return create(FunctionExpressionFactory.maxExp(getExpression()), getType()); }
/** * @param lower The lower bound. * @param upper The upper bound. * @return An expression checking for objects between a lower and upper * bound inclusive */ public Expression between(E lower, E upper) { return ExpressionFactory.betweenExp(getExpression(), lower, upper); }
/** * @see FunctionExpressionFactory#substringExp(Expression, int, int) */ public Property<String> substring(int offset, int length) { return create(FunctionExpressionFactory.substringExp(getExpression(), offset, length), String.class); }
/** * @return An expression for a database "LIKE" query with the value * converted to a pattern matching the beginning of the String. * @since 4.0 */ public static Expression endsWithExp(String pathSpec, String value) { ASTLike like = likeExpInternal(pathSpec, value, (char) 0); LikeExpressionHelper.toEndsWith(like); return like; }
/** * Same as {@link #containsExp(String, String)} only using case-insensitive * comparison. * * @since 4.0 */ public static Expression containsIgnoreCaseExp(String pathSpec, String value) { ASTLikeIgnoreCase like = likeIgnoreCaseExpInternal(pathSpec, value, (char) 0); LikeExpressionHelper.toContains(like); return like; }
/** * Creates an expression for a database "LIKE" query with the value converted to a pattern matching the beginning of * a String. * * @param value a String to match against property value. "_" and "%" symbols * are NOT treated as wildcards and are escaped when converted to * a LIKE expression. * @return a newly created expression. */ public Expression startsWith(String value) { return ExpressionFactory.startsWithExp(getExpression(), value); }
/** * Creates an expression for a database "LIKE" query with the value * converted to a pattern matching the tail of a String. * * @param value a String to match against property value. "_" and "%" symbols * are NOT treated as wildcards and are escaped when converted to * a LIKE expression. * @return a newly created expression. */ public Expression endsWith(String value) { return ExpressionFactory.endsWithExp(getExpression(), value); }
/** * @return An expression for finding objects with values not in the given * set. */ public Expression nin(Collection<E> values) { return ExpressionFactory.notInExp(getExpression(), values); }
/** * @since 4.0 * @see ExpressionFactory#containsExp(String, String) */ static Expression containsExp(Expression exp, String value) { ASTLike like = likeExpInternal(exp, value, (char) 0); LikeExpressionHelper.toContains(like); return like; }
/** * @return An expression for a database "LIKE" query with the value * converted to a pattern matching the beginning of the String. * @since 4.0 */ public static Expression startsWithExp(String pathSpec, String value) { ASTLike like = likeExpInternal(pathSpec, value, (char) 0); LikeExpressionHelper.toStartsWith(like); return like; }
/** * Same as {@link #startsWithExp(String, String)} only using * case-insensitive comparison. * * @since 4.0 */ public static Expression startsWithIgnoreCaseExp(String pathSpec, String value) { ASTLikeIgnoreCase like = likeIgnoreCaseExpInternal(pathSpec, value, (char) 0); LikeExpressionHelper.toStartsWith(like); return like; }
/** * @return An expression representing equality to a value. */ public Expression eq(E value) { return ExpressionFactory.matchExp(getExpression(), value); }
/** * @return An expression representing inequality to a value. */ public Expression ne(E value) { return ExpressionFactory.noMatchExp(getExpression(), value); }
/** * @since 4.0 * @see ExpressionFactory#endsWithExp(String, String) */ static Expression endsWithExp(Expression exp, String value) { ASTLike like = likeExpInternal(exp, value, (char) 0); LikeExpressionHelper.toEndsWith(like); return like; }