Class EntityProperty<E extends Persistent>
java.lang.Object
org.apache.cayenne.exp.property.BaseProperty<E>
org.apache.cayenne.exp.property.EntityProperty<E>
- All Implemented Interfaces:
PathProperty<E>, Property<E>, RelationshipProperty<E>
- Direct Known Subclasses:
SelfProperty
public class EntityProperty<E extends Persistent>
extends BaseProperty<E>
implements RelationshipProperty<E>
Property that represents to-one relationships.
Usage examples in where clause:
ObjectSelect.query(Paintings.class)
.where(Painting.TO_ARTIST.dot(Artist.ARTIST_NAME).eq("Pablo Picasso"));
Usage examples in column select, in this case full Artist entity will be returned as the result:
ObjectSelect
.columnQuery(Paintings.class, Painting.PAINTING_TITLE, Painting.TO_ARTIST);
- Since:
- 4.2
- See Also:
-
Field Summary
Fields inherited from class BaseProperty
expressionSupplier, path, typeModifier and TypeFieldDescriptionprotected final Supplier<Expression> Expression provider for the propertyprotected final CayennePathPath of this propertyExplicit type of the property -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEntityProperty(CayennePath path, Expression expression, Class<E> type) Constructs a new property with the given name and expression -
Method Summary
Modifier and TypeMethodDescriptionCreates alias with different name for this propertyThis operator allows to access properties of the enclosing query from the subquery.idsInCollection(Collection<?> ids) idsNotInCollection(Collection<?> ids) Deprecated, for removal: This API element is subject to removal in a future version.inId(Collection<Object> ids) Deprecated, for removal: This API element is subject to removal in a future version.since 5.0 in favour ofidsInCollection(Collection)Deprecated, for removal: This API element is subject to removal in a future version.since 5.0 in favour ofidsNotIn(Object...)ninId(Collection<Object> ids) Deprecated, for removal: This API element is subject to removal in a future version.since 5.0 in favour ofidsNotInCollection(Collection)outer()Returns a version of this property that represents an OUTER join.Methods inherited from class BaseProperty
aggregate, asc, ascInsensitive, ascInsensitives, ascs, count, countDistinct, desc, descInsensitive, descInsensitives, descs, eq, eq, equals, function, function, getAlias, getExpression, getFrom, getFromAll, getName, getPath, getType, hashCode, in, in, in, isFalse, isNotNull, isNull, isTrue, ne, ne, nin, nin, nin, operator, operator, setIn, setInAllModifier and TypeMethodDescription<T> BaseProperty<T> asc()ascs()count()desc()descs()eq(BaseProperty<?> value) boolean<T> BaseProperty<T> <T> BaseProperty<T> function(String functionName, Class<T> returnType, BaseProperty<?>... arguments) getAlias()This method returns fresh copy of the expression for each call.Extracts property value from an object using JavaBean-compatible introspection with one addition - a property can be a dot-separated property name path.getFromAll(Collection<?> beans) Extracts property value from a collection of objects using JavaBean-compatible introspection with one addition - a property can be a dot-separated property name path.getName()getPath()getType()inthashCode()in(Collection<E> values) in(ColumnSelect<? extends E> subquery) isFalse()isNull()isTrue()ne(BaseProperty<?> value) nin(Collection<E> values) nin(ColumnSelect<? extends E> subquery) <T> BaseProperty<T> <T> BaseProperty<T> operator(String operator, Class<T> returnType, BaseProperty<?>... arguments) voidSets a property value in 'obj' using JavaBean-compatible introspection with one addition - a property can be a dot-separated property name path.voidsetInAll(Collection<?> beans, E value) Sets a property value in a collection of objects using JavaBean-compatible introspection with one addition - a property can be a dot-separated property name path.Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PathProperty
dot, dot, dot, dot, dotModifier and TypeMethodDescriptiondefault BaseProperty<Object> Constructs a property path by appending the argument to the existing property separated by a dot.default <T> BaseProperty<T> dot(BaseProperty<T> property) Constructs a new property path by appending the argument to the existing property separated by a dot.default <T> DateProperty<T> dot(DateProperty<T> property) Constructs a new property path by appending the argument to the existing property separated by a dot.default <T extends Number>
NumericProperty<T> dot(NumericProperty<T> property) Constructs a new property path by appending the argument to the existing property separated by a dot.default <T extends CharSequence>
StringProperty<T> dot(StringProperty<T> property) Constructs a new property path by appending the argument to the existing property separated by a dot.Methods inherited from interface RelationshipProperty
disjoint, disjointById, dot, dot, dot, dot, dot, dot, dot, exists, joint, notExistsModifier and TypeMethodDescriptiondefault PrefetchTreeNodedisjoint()Returns a prefetch tree that follows this property path, potentially spanning a number of phantom nodes, and having a single leaf with "disjoint" prefetch semantics.default PrefetchTreeNodeReturns a prefetch tree that follows this property path, potentially spanning a number of phantom nodes, and having a single leaf with "disjoint by id" prefetch semantics.default <T> BaseIdProperty<T> dot(BaseIdProperty<T> property) Constructs a new property path by appending the argument to the existing property separated by a dot.default <T extends EmbeddableObject>
EmbeddableProperty<T> dot(EmbeddableProperty<T> property) Constructs a new property path by appending the argument to the existing property separated by a dot.default <T extends Persistent>
EntityProperty<T> dot(EntityProperty<T> property) Constructs a new property path by appending the argument to the existing property separated by a dot.default <T extends Persistent>
ListProperty<T> dot(ListProperty<T> property) Constructs a new property path by appending the argument to the existing property separated by a dot.default <K, V extends Persistent>
MapProperty<K, V> dot(MapProperty<K, V> property) Constructs a new property path by appending the argument to the existing property separated by a dot.default <T extends Number>
NumericIdProperty<T> dot(NumericIdProperty<T> property) Constructs a new property path by appending the argument to the existing property separated by a dot.default <T extends Persistent>
SetProperty<T> dot(SetProperty<T> property) Constructs a new property path by appending the argument to the existing property separated by a dot.default Expressionexists()default PrefetchTreeNodejoint()Returns a prefetch tree that follows this property path, potentially spanning a number of phantom nodes, and having a single leaf with "joint" prefetch semantics.default Expression
-
Constructor Details
-
EntityProperty
Constructs a new property with the given name and expression- Parameters:
path- of the property (will be used as alias for the expression)expression- expression for propertytype- of the property- See Also:
-
-
Method Details
-
eqId
-
inId
Deprecated, for removal: This API element is subject to removal in a future version.since 5.0 in favour ofidsInCollection(Collection) -
idsInCollection
- Parameters:
ids- to use for "IN" expression- Returns:
INexpression comparing path represented by this property with provided ids- Since:
- 5.0
-
inId
Deprecated, for removal: This API element is subject to removal in a future version.since 5.0 in favour ofidsIn(Object...) -
idsIn
- Parameters:
ids- to use for "IN" expression- Returns:
INexpression comparing path represented by this property with provided ids- Since:
- 5.0
-
neqId
-
ninId
Deprecated, for removal: This API element is subject to removal in a future version.since 5.0 in favour ofidsNotInCollection(Collection) -
idsNotInCollection
- Parameters:
ids- collection of IDs to use for "NOT IN" expression- Returns:
NOT INexpression comparing path represented by this property with provided IDs- Since:
- 5.0
-
ninId
@Deprecated(since="5.0", forRemoval=true) public Expression ninId(Object firstId, Object... moreIds) Deprecated, for removal: This API element is subject to removal in a future version.since 5.0 in favour ofidsNotIn(Object...) -
idsNotIn
- Parameters:
ids- to use for "NOT IN" expression- Returns:
NOT INexpression comparing path represented by this property with provided ids- Since:
- 5.0
-
alias
Creates alias with different name for this property- Overrides:
aliasin classBaseProperty<E extends Persistent>
-
outer
Returns a version of this property that represents an OUTER join.- Specified by:
outerin interfaceRelationshipProperty<E extends Persistent>
-
enclosing
Description copied from class:BasePropertyThis operator allows to access properties of the enclosing query from the subquery. It allows multiple nesting levels to access a corresponding query in case of multiple levels of subqueries. Example:ObjectSelect.query(Artist.class) .where(ExpressionFactory.notExists(ObjectSelect.query(Painting.class) .where(Painting.TO_ARTIST.eq(Artist.ARTIST_ID_PK_PROPERTY.enclosing()))))- Overrides:
enclosingin classBaseProperty<E extends Persistent>- Returns:
- property that will be translated relative to parent query
-
idsIn(Object...)