/** * Puts an {@link Expression} in parenthesis. * * @param expression the expression to wrap in parenthesis. * @return the expression, wrapped in parenthesis. */ public static Expression par(final Expression expression) { return infix(expression.toString(), "(", ")"); }
/** * Combines two expressions with the greater or equals than operator (">="). * * @param right the expression to combine. * @return the combined expressions. */ public Expression gte(Expression right) { return infix(">=", toString(), right.toString()); }
/** * OR-combines two expressions. * * @param right the expression to combine with the current one. * @return a combined expression. */ public Expression or(Expression right) { return infix("OR", toString(), right.toString()); }
/** * Adds a NOT BETWEEN clause between the current and the given expression. * * @param right the right hand side expression. * @return a new expression with the clause applied. */ public Expression notBetween(Expression right) { return infix("NOT BETWEEN", toString(), right.toString()); }
/** * Adds a NOT IN clause between the current and the given expression. * * @param right the right hand side expression. * @return a new expression with the clause applied. */ public Expression notIn(Expression right) { return infix("NOT IN", toString(), right.toString()); }
/** * Arithmetic addition between current and given expression. * * @param expression the right hand side expression. * @return the addition expression. */ public Expression add(Expression expression) { return infix("+", toString(), expression.toString()); }
/** * AND-combines two expressions. * * @param right the expression to combine with the current one. * @return a combined expression. */ public Expression and(Expression right) { return infix("AND", toString(), right.toString()); }
/** * Combines two expressions with the less than operator ("<"). * * @param right the expression to combine. * @return the combined expressions. */ public Expression lt(Expression right) { return infix("<", toString(), right.toString()); }
/** * Adds a BETWEEN clause between the current and the given expression. * * @param right the right hand side expression. * @return a new expression with the clause applied. */ public Expression between(Expression right) { return infix("BETWEEN", toString(), right.toString()); }
/** * Arithmetic division between current and given expression. * * @param expression the right hand side expression. * @return the division expression. */ public Expression divide(Expression expression) { return infix("/", toString(), expression.toString()); }
/** * Combines two expressions with the not equals operator ("!="). * * @param right the expression to combine. * @return the combined expressions. */ public Expression ne(Expression right) { return infix("!=", toString(), right.toString()); }
/** * Combines two expressions with the greater than operator (">"). * * @param right the expression to combine. * @return the combined expressions. */ public Expression gt(Expression right) { return infix(">", toString(), right.toString()); }
/** * Combines two expressions with the concatenation operator ("||"). * * @param right the expression to combine. * @return the combined expressions. */ public Expression concat(Expression right) { return infix("||", toString(), right.toString()); }
/** * Combines two expressions with the less or equals than operator ("<="). * * @param right the expression to combine. * @return the combined expressions. */ public Expression lte(Expression right) { return infix("<=", toString(), right.toString()); }
/** * Combines two expressions with the equals operator ("="). * * @param right the expression to combine. * @return the combined expressions. */ public Expression eq(Expression right) { return infix("=", toString(), right.toString()); }
/** * Adds a LIKE clause between the current and the given expression. * * @param right the right hand side expression. * @return a new expression with the clause applied. */ public Expression like(Expression right) { return infix("LIKE", toString(), right.toString()); }
/** * Adds a IN clause between the current and the given expression. * * @param right the right hand side expression. * @return a new expression with the clause applied. */ public Expression in(Expression right) { return infix("IN", toString(), right.toString()); }
/** * Adds a AS clause between the current and the given expression. Often used to alias an identifier. * * @param alias the right hand side expression. * @return a new expression with the clause applied. */ public Expression as(Expression alias) { return infix("AS", toString(), alias.toString()); }
/** * Arithmetic v between current and given expression. * * @param expression the right hand side expression. * @return the subtraction expression. */ public Expression subtract(Expression expression) { return infix("-", toString(), expression.toString()); }
/** * Arithmetic multiplication between current and given expression. * * @param expression the right hand side expression. * @return the multiplication expression. */ public Expression multiply(Expression expression) { return infix("*", toString(), expression.toString()); }