/** * A convenience shortcut for building LIKE expression. */ public static Expression likeExp(String pathSpec, Object value) { return likeExpInternal(pathSpec, value, (char) 0); }
/** * @since 4.0 * @see ExpressionFactory#likeExp(String, Object) */ static Expression likeExp(Expression exp, Object value) { return likeExpInternal(exp, value, (char) 0); }
/** * @since 4.0 * @see ExpressionFactory#likeExp(String, Object) */ static Expression likeExp(Expression exp, Object value, char escapeChar) { return likeExpInternal(exp, value, escapeChar); }
/** * <p> * A convenience shortcut for building LIKE expression. * </p> * <p> * The escape character allows for escaping meta-characters in the LIKE * clause. Note that the escape character cannot be '?'. To specify no * escape character, supply 0 as the escape character. * </p> * * @since 3.0.1 */ public static Expression likeExp(String pathSpec, Object value, char escapeChar) { return likeExpInternal(pathSpec, value, escapeChar); }
/** * @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; }
/** * @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; }
/** * @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; }
/** * @since 4.0 * @see ExpressionFactory#startsWithExp(String, String) */ static Expression startsWithExp(Expression exp, String value) { ASTLike like = likeExpInternal(exp, value, (char) 0); LikeExpressionHelper.toStartsWith(like); return like; }
/** * @return An expression for a database "LIKE" query with the value * converted to a pattern matching anywhere in the String. * @since 4.0 */ public static Expression containsExp(String pathSpec, String value) { ASTLike like = likeExpInternal(pathSpec, value, (char) 0); LikeExpressionHelper.toContains(like); return like; }
static ASTLike likeExpInternal(String pathSpec, Object value, char escapeChar) { return likeExpInternal(new ASTObjPath(pathSpec), value, escapeChar); }