/** * Creates a copy of this expression node, without copying children. */ @Override public Expression shallowCopy() { ASTDbPath copy = new ASTDbPath(id); copy.path = path; return copy; }
/** * @param pathSpec a String db: path. * @since 4.0 * @return a new "db:" path expression for the specified String path. */ public static Expression dbPathExp(String pathSpec) { return new ASTDbPath(pathSpec); }
/** * A convenience method to create an DB_PATH "not equal to" expression. */ public static Expression noMatchDbExp(String pathSpec, Object value) { return new ASTNotEqual(new ASTDbPath(pathSpec), value); }
/** * A convenience method to create an DB_PATH "less than or equal to" * expression. * * @since 3.0 */ public static Expression lessOrEqualDbExp(String pathSpec, Object value) { return new ASTLessOrEqual(new ASTDbPath(pathSpec), value); }
/** * A convenience shortcut for building LIKE DB_PATH expression. * * @since 3.0 */ public static Expression likeDbExp(String pathSpec, Object value) { return new ASTLike(new ASTDbPath(pathSpec), value); }
/** * A convenience shortcut for building NOT_LIKE expression. * * @since 3.0 */ public static Expression notLikeDbExp(String pathSpec, Object value) { return new ASTNotLike(new ASTDbPath(pathSpec), value); }
/** * A convenience shortcut for building LIKE_IGNORE_CASE expression. * * @since 3.0 */ public static Expression likeIgnoreCaseDbExp(String pathSpec, Object value) { return new ASTLikeIgnoreCase(new ASTDbPath(pathSpec), value); }
/** * A convenience method to create an DB_PATH "less than" expression. * * @since 3.0 */ public static Expression lessDbExp(String pathSpec, Object value) { return new ASTLess(new ASTDbPath(pathSpec), value); }
/** * A convenience shortcut for building BETWEEN expressions. * * @since 3.0 */ public static Expression betweenDbExp(String pathSpec, Object value1, Object value2) { return new ASTBetween(new ASTDbPath(pathSpec), value1, value2); }
/** * A convenience shortcut for building NOT_BETWEEN expressions. * * @since 3.0 */ public static Expression notBetweenDbExp(String pathSpec, Object value1, Object value2) { return new ASTNotBetween(new ASTDbPath(pathSpec), value1, value2); }
/** * A convenience method to create an DB_PATH "greater than" expression. * * @since 3.0 */ public static Expression greaterDbExp(String pathSpec, Object value) { return new ASTGreater(new ASTDbPath(pathSpec), value); }
/** * A convenience method to create an DB_PATH "not equal to" expression. */ public static Expression noMatchDbExp(String pathSpec, Object value) { return new ASTNotEqual(new ASTDbPath(pathSpec), value); }
/** * A convenience method to create an DB_PATH "equal to" expression. */ public static Expression matchDbExp(String pathSpec, Object value) { return new ASTEqual(new ASTDbPath(pathSpec), value); }
/** * A convenience shortcut for building NOT_LIKE_IGNORE_CASE expression. * * @since 3.0 */ public static Expression notLikeIgnoreCaseDbExp(String pathSpec, Object value) { return new ASTNotLikeIgnoreCase(new ASTDbPath(pathSpec), value); }
public Object transform(Object input) { if (input instanceof ASTObjPath) { return new ASTDbPath(((SimpleNode) input).getOperand(0)); } return input; } }
public Object transform(Object input) { if (input instanceof ASTPath) { return new ASTDbPath(pathToRoot.toString() + ((ASTPath) input).getPath()); } return input; } }
/** * A convenience shortcut for building IN DB expression. */ public static Expression inDbExp(String pathSpec, Object[] values) { return new ASTIn(new ASTDbPath(pathSpec), new ASTList(values)); }
/** * A convenience shortcut for building NOT_IN expression. Return ASTTrue for * empty collection. * * @since 3.0 */ public static Expression notInDbExp(String pathSpec, Object... values) { if (values.length == 0) { return new ASTTrue(); } return new ASTNotIn(new ASTDbPath(pathSpec), new ASTList(values)); }
/** * A convenience shortcut for building IN DB expression. Return ASTFalse for * empty collection. */ public static Expression inDbExp(String pathSpec, Collection<?> values) { if (values.isEmpty()) { return new ASTFalse(); } return new ASTIn(new ASTDbPath(pathSpec), new ASTList(values)); }
/** * A convenience shortcut for building IN DB expression. Return ASTFalse for * empty collection. */ public static Expression inDbExp(String pathSpec, Object... values) { if (values.length == 0) { return new ASTFalse(); } return new ASTIn(new ASTDbPath(pathSpec), new ASTList(values)); }