/** * Returns a version of this property that represents an OUTER join. It is * up to caller to ensure that the property corresponds to a relationship, * as "outer" attributes make no sense. */ public Property<E> outer() { return isOuter() ? this : create(name + "+", type); }
/** * Constructs a property path by appending the argument to the existing property separated by a dot. * * @return a newly created Property object. */ public Property<Object> dot(String property) { return create(getName() + "." + property, null); }
/** * @see FunctionExpressionFactory#lengthExp(Expression) */ public Property<Integer> length() { return create(FunctionExpressionFactory.lengthExp(getExpression()), Integer.class); }
/** * @see FunctionExpressionFactory#substringExp(Expression, int, int) */ public Property<String> substring(int offset, int length) { return create(FunctionExpressionFactory.substringExp(getExpression(), offset, length), String.class); }
/** * @see FunctionExpressionFactory#trimExp(Expression) */ public Property<String> trim() { return create(FunctionExpressionFactory.trimExp(getExpression()), String.class); }
/** * @see FunctionExpressionFactory#lowerExp(Expression) */ public Property<String> lower() { return create(FunctionExpressionFactory.lowerExp(getExpression()), String.class); }
/** * @see FunctionExpressionFactory#countExp(Expression) */ public Property<Long> count() { return create(FunctionExpressionFactory.countExp(getExpression()), Long.class); }
/** * @see FunctionExpressionFactory#upperExp(Expression) */ public Property<String> upper() { return create(FunctionExpressionFactory.upperExp(getExpression()), String.class); }
/** * <p>Create new "flat" property for toMany relationship.</p> * <p> * Example: * <pre>{@code * List<Object[]> result = ObjectSelect * .columnQuery(Artist.class, Artist.ARTIST_NAME, Artist.PAINTING_ARRAY.flat(Painting.class)) * .select(context); * }</pre> * </p> */ public <T extends Persistent> Property<T> flat(Class<? super T> tClass) { if(!Collection.class.isAssignableFrom(type) && !Map.class.isAssignableFrom(type)) { throw new CayenneRuntimeException("Can use flat() function only on Property mapped on toMany relationship."); } return create(ExpressionFactory.fullObjectExp(getExpression()), tClass); }
/** * @see FunctionExpressionFactory#minExp(Expression) */ public Property<E> min() { return create(FunctionExpressionFactory.minExp(getExpression()), getType()); }
/** * @see FunctionExpressionFactory#sqrtExp(Expression) */ public Property<E> sqrt() { return create(FunctionExpressionFactory.sqrtExp(getExpression()), getType()); }
/** * Constructs a new property path by appending the argument to the existing property separated by a dot. * * @return a newly created Property object. */ public <T> Property<T> dot(Property<T> property) { return create(getName() + "." + property.getName(), property.getType()); }
/** * @see FunctionExpressionFactory#sumExp(Expression) */ public Property<E> sum() { return create(FunctionExpressionFactory.sumExp(getExpression()), getType()); }
/** * @see FunctionExpressionFactory#absExp(Expression) */ public Property<E> abs() { return create(FunctionExpressionFactory.absExp(getExpression()), getType()); }
/** * @see FunctionExpressionFactory#maxExp(Expression) */ public Property<E> max() { return create(FunctionExpressionFactory.maxExp(getExpression()), getType()); }
/** * @see FunctionExpressionFactory#avgExp(Expression) */ public Property<E> avg() { return create(FunctionExpressionFactory.avgExp(getExpression()), getType()); }
/** * @see FunctionExpressionFactory#modExp(Expression, Number) */ public Property<E> mod(Number number) { return create(FunctionExpressionFactory.modExp(getExpression(), number), getType()); }
/** * @see FunctionExpressionFactory#locateExp(String, Expression) */ public Property<Integer> locate(String string) { return create(FunctionExpressionFactory.locateExp(ExpressionFactory.wrapScalarValue(string), getExpression()), Integer.class); }
/** * @see FunctionExpressionFactory#locateExp(Expression, Expression) */ public Property<Integer> locate(Property<? extends String> property) { return create(FunctionExpressionFactory.locateExp(property.getExpression(), getExpression()), Integer.class); }
return create(FunctionExpressionFactory.concatExp(exp), String.class);