/** * PUBLIC: * Return a new expression that aplies the function to the given expression. */ public static Expression add(Expression left, int right) { return add(left, new Integer(right)); }
/** * PUBLIC: * Return a new expression that applies the function to the given expression. */ public static Expression atan2(Expression expression, int value) { return atan2(expression, new Integer(value)); }
/** * PUBLIC: * Return a new expression that aplies the function to the given expression. */ public static Expression divide(Expression left, int right) { return divide(left, new Integer(right)); }
/** * PUBLIC: * Return a new expression that applies the function to the given expression. */ public static Expression mod(Expression expression, int base) { return mod(expression, new Integer(base)); }
/** * PUBLIC: * Return a new expression that applies the function to the given expression. */ public static Expression multiply(Expression left, int right) { return multiply(left, new Integer(right)); }
/** * PUBLIC: * Return a new expression that applies the function to the given expression. */ public static Expression min(Expression left, int right) { return min(left, new Integer(right)); }
/** * PUBLIC: * Return a new expression that applies the function to the given expression. */ public static Expression max(Expression left, int right) { return max(left, new Integer(right)); }
/** * PUBLIC: * Return a new expression that applies the function to the given expression. */ public static Expression power(Expression expression, int raised) { return power(expression, new Integer(raised)); }
/** * PUBLIC: * Return a new expression that applies the function to the given expression. */ public static Expression round(Expression expression, int decimalPlaces) { return round(expression, new Integer(decimalPlaces)); }
/** * INTERNAL * Generate the TopLink expression for this node */ public Expression generateExpression(GenerationContext context) { Expression whereClause = getLeft().generateExpression(context); whereClause = ExpressionMath.abs(whereClause); return whereClause; }
/** */ public Expression generateExpression(GenerationContext context) { return ExpressionMath.mod(getLeft().generateExpression(context), getDenominator().generateExpression(context)); }
/** * INTERNAL * Generate the expression. The steps are: * 1. Generate the expression for the left node * 2. Add the .multiply to the where clause returned from step 1 * 3. Generate the expression for the right side and use it as the parameter for the .multiply() * 4. Return the completed where clause to the caller */ public Expression generateExpression(GenerationContext context) { Expression whereClause = getLeft().generateExpression(context); whereClause = ExpressionMath.multiply(whereClause, getRight().generateExpression(context)); return whereClause; }
/** * INTERNAL: * Retrun an expression that updates the write lock */ public Expression getWriteLockUpdateExpression(ExpressionBuilder builder) { return ExpressionMath.add(builder.getField(writeLockField.getName()), 1); }
/** * INTERNAL * Generate the expression. The steps are: * 1. Generate the expression for the left node * 2. Add the .divide to the where clause returned from step 1 * 3. Generate the expression for the right side and use it as the parameter for the .divide() * 4. Return the completed where clause to the caller */ public Expression generateExpression(GenerationContext context) { Expression whereClause = getLeft().generateExpression(context); whereClause = ExpressionMath.divide(whereClause, getRight().generateExpression(context)); return whereClause; }
/** * INTERNAL * Generate the expression. The steps are: * 1. Generate the expression for the left node * 2. Add the .plus to the where clause returned from step 1 * 3. Generate the expression for the right side and use it as the parameter for the .plus() * 4. Return the completed where clause to the caller */ public Expression generateExpression(GenerationContext context) { Expression whereClause = getLeft().generateExpression(context); whereClause = ExpressionMath.add(whereClause, getRight().generateExpression(context)); return whereClause; }