/** * Creates property with name and type * @see Property#create(Expression, Class) * @see Property#create(String, Expression, Class) */ public static <T> Property<T> create(String name, Class<? super T> type) { return new Property<>(name, type); }
/** * Creates property with name, expression and type * @see Property#create(String, Class) * @see Property#create(Expression, Class) */ public static <T> Property<T> create(String name, Expression expression, Class<? super T> type) { return new Property<>(name, expression, type); }
/** * Creates property with expression and type * @see Property#create(String, Class) * @see Property#create(String, Expression, Class) */ public static <T> Property<T> create(Expression expression, Class<? super T> type) { return new Property<>(null, expression, type); }
/** * <p> * Creates "self" Property for persistent class. * This property can be used to select full object along with some of it properties (or * properties that can be resolved against query root) * </p> * <p> * Here is sample code, that will select all Artists and count of their Paintings: * <pre>{@code * Property<Artist> artistFull = Property.createSelf(Artist.class); * List<Object[]> result = ObjectSelect * .columnQuery(Artist.class, artistFull, Artist.PAINTING_ARRAY.count()) * .select(context); * } * </pre> * </p> */ public static <T extends Persistent> Property<T> createSelf(Class<? super T> type) { return new Property<>(null, ExpressionFactory.fullObjectExp(), type); }
/** * Creates alias with different name for this property */ public Property<E> alias(String alias) { return new Property<>(alias, this.getExpression(), this.getType()); }