Package org.apache.cayenne.exp.property
Class BaseProperty<E>
java.lang.Object
org.apache.cayenne.exp.property.BaseProperty<E>
- All Implemented Interfaces:
- Property<E>
- Direct Known Subclasses:
- BaseIdProperty,- CollectionProperty,- DateProperty,- EmbeddableProperty,- EntityProperty,- MapProperty,- NumericProperty,- StringProperty
Property that represents generic attribute.
 
Provides equality checks and sorting API along with some utility methods.
- Since:
- 4.2
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final Supplier<Expression>Expression provider for the propertyprotected final CayennePathPath of this propertyExplicit type of the property
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedBaseProperty(CayennePath path, Expression expression, Class<? super E> type) Constructs a new property with the given name and expression
- 
Method SummaryModifier and TypeMethodDescription<T> BaseProperty<T>Creates alias with different name for this propertyasc()ascs()count()desc()descs()This operator allows to access properties of the enclosing query from the subquery.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.
- 
Field Details- 
pathPath of this property
- 
expressionSupplierExpression provider for the property
- 
typeExplicit type of the property
 
- 
- 
Constructor Details- 
BasePropertyConstructs a new property with the given name and expression- Parameters:
- path- path value of the property (will be used as alias for the expression)
- expression- expression for property
- type- of the property
- See Also:
 
 
- 
- 
Method Details- 
getName
- 
getPath
- 
getAlias
- 
getExpressionThis method returns fresh copy of the expression for each call.- Specified by:
- getExpressionin interface- Property<E>
- Returns:
- expression that represents this Property
 
- 
hashCodepublic int hashCode()
- 
equals
- 
isNull- Returns:
- An expression representing null.
 
- 
isNotNull- Returns:
- An expression representing a non-null value.
 
- 
asc- Returns:
- Ascending sort orderings on this property.
 
- 
ascs- Returns:
- Ascending sort orderings on this property.
 
- 
ascInsensitive- Returns:
- Ascending case-insensitive sort orderings on this property.
 
- 
ascInsensitives- Returns:
- Ascending case-insensitive sort orderings on this property.
 
- 
desc- Returns:
- Descending sort orderings on this property.
 
- 
descs- Returns:
- Descending sort orderings on this property.
 
- 
descInsensitive- Returns:
- Descending case-insensitive sort orderings on this property.
 
- 
descInsensitives- Returns:
- Descending case-insensitive sort orderings on this property.
 
- 
getFromExtracts property value from an object using JavaBean-compatible introspection with one addition - a property can be a dot-separated property name path.
- 
getFromAllExtracts property value from a collection of objects using JavaBean-compatible introspection with one addition - a property can be a dot-separated property name path.
- 
setInSets a property value in 'obj' using JavaBean-compatible introspection with one addition - a property can be a dot-separated property name path.
- 
setInAllSets 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.
- 
count
- 
countDistinct
- 
aggregate- Since:
- 5.0
- See Also:
 
- 
aliasCreates alias with different name for this property
- 
getType
- 
isTrue- Returns:
- An expression representing equality to TRUE.
 
- 
isFalse- Returns:
- An expression representing equality to FALSE.
 
- 
eq- Returns:
- An expression representing equality to a value.
 
- 
eq- Returns:
- An expression representing equality between two attributes (columns).
 
- 
ne- Returns:
- An expression representing inequality to a value.
 
- 
ne- Returns:
- An expression representing inequality between two attributes (columns).
 
- 
in- Returns:
- An expression for finding objects with values in the given set.
 
- 
nin- Returns:
- An expression for finding objects with values not in the given set.
 
- 
in- Returns:
- An expression for finding objects with values in the given set.
 
- 
nin- Returns:
- An expression for finding objects with values not in the given set.
 
- 
in- Returns:
- An expression for finding objects with values in the given subquery
 
- 
nin- Returns:
- An expression for finding objects with values not in the given subquery
 
- 
enclosingThis 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()))))- Returns:
- property that will be translated relative to a parent query
 
- 
functionpublic <T> BaseProperty<T> function(String functionName, Class<T> returnType, BaseProperty<?>... arguments) - Returns:
- An expression for calling functionName with first argument equals to this property and provided additional arguments
 
- 
function- Returns:
- An expression for calling functionName with first argument equals to this property and provided additional arguments
 
- 
operatorpublic <T> BaseProperty<T> operator(String operator, Class<T> returnType, BaseProperty<?>... arguments) - Returns:
- An expression for using operator with first argument equals to this property and provided additional arguments
 
- 
operator- Returns:
- An expression for using operator with first argument equals to this property and provided additional arguments
 
 
-