public class BaseProperty<E> extends Object implements Property<E>
Provides equality checks and sorting API along with some utility methods.
org.apache.cayenne.exp.property
Modifier and Type | Field and Description |
---|---|
protected Supplier<Expression> |
expressionSupplier
Expression provider for the property
|
protected String |
name
Name of the property in the object
|
protected Class<E> |
type
Explicit type of the property
|
Modifier | Constructor and Description |
---|---|
protected |
BaseProperty(String name,
Expression expression,
Class<? super E> type)
Constructs a new property with the given name and expression
|
Modifier and Type | Method and Description |
---|---|
BaseProperty<E> |
alias(String alias)
Creates alias with different name for this property
|
Ordering |
asc() |
Ordering |
ascInsensitive() |
Orderings |
ascInsensitives() |
Orderings |
ascs() |
NumericProperty<Long> |
count() |
NumericProperty<Long> |
countDistinct() |
Ordering |
desc() |
Ordering |
descInsensitive() |
Orderings |
descInsensitives() |
Orderings |
descs() |
BaseProperty<E> |
enclosing() |
Expression |
eq(BaseProperty<?> value) |
Expression |
eq(E value) |
boolean |
equals(Object o) |
<T> BaseProperty<T> |
function(String functionName,
Class<T> returnType,
BaseProperty<?>... arguments) |
<T> BaseProperty<T> |
function(String functionName,
Class<T> returnType,
Object... arguments) |
String |
getAlias() |
Expression |
getExpression()
This method returns fresh copy of the expression for each call.
|
E |
getFrom(Object bean)
Extracts property value from an object using JavaBean-compatible
introspection with one addition - a property can be a dot-separated
property name path.
|
List<E> |
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.
|
String |
getName() |
Class<E> |
getType() |
int |
hashCode() |
Expression |
in(Collection<E> values) |
Expression |
in(ColumnSelect<? extends E> subquery) |
Expression |
in(E firstValue,
E... moreValues) |
Expression |
isFalse() |
Expression |
isNotNull() |
Expression |
isNull() |
Expression |
isTrue() |
Expression |
ne(BaseProperty<?> value) |
Expression |
ne(E value) |
Expression |
nin(Collection<E> values) |
Expression |
nin(ColumnSelect<? extends E> subquery) |
Expression |
nin(E firstValue,
E... moreValues) |
<T> BaseProperty<T> |
operator(String operator,
Class<T> returnType,
BaseProperty<?>... arguments) |
<T> BaseProperty<T> |
operator(String operator,
Class<T> returnType,
Object... arguments) |
Expression |
path()
Deprecated.
since 4.2, use
getExpression() method instead |
void |
setIn(Object bean,
E value)
Sets a property value in 'obj' using JavaBean-compatible introspection
with one addition - a property can be a dot-separated property name path.
|
void |
setInAll(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.
|
protected final String name
protected final Supplier<Expression> expressionSupplier
protected BaseProperty(String name, Expression expression, Class<? super E> type)
name
- of the property (will be used as alias for the expression)expression
- expression for propertytype
- of the propertyPropertyFactory.createBase(String, Expression, Class)
public String getName()
public String getAlias()
public Expression getExpression()
getExpression
in interface Property<E>
@Deprecated public Expression path()
getExpression()
method insteadgetExpression()
public Expression isNull()
public Expression isNotNull()
public Ordering asc()
public Orderings ascs()
public Ordering ascInsensitive()
public Orderings ascInsensitives()
public Ordering desc()
public Orderings descs()
public Ordering descInsensitive()
public Orderings descInsensitives()
public E getFrom(Object bean)
public List<E> getFromAll(Collection<?> beans)
public void setIn(Object bean, E value)
public void setInAll(Collection<?> beans, E value)
public NumericProperty<Long> count()
public NumericProperty<Long> countDistinct()
public BaseProperty<E> alias(String alias)
public Expression isTrue()
public Expression isFalse()
public Expression eq(E value)
public Expression eq(BaseProperty<?> value)
public Expression ne(E value)
public Expression ne(BaseProperty<?> value)
public Expression in(E firstValue, E... moreValues)
public Expression nin(E firstValue, E... moreValues)
public Expression in(Collection<E> values)
public Expression nin(Collection<E> values)
public Expression in(ColumnSelect<? extends E> subquery)
public Expression nin(ColumnSelect<? extends E> subquery)
public BaseProperty<E> enclosing()
public <T> BaseProperty<T> function(String functionName, Class<T> returnType, BaseProperty<?>... arguments)
public <T> BaseProperty<T> function(String functionName, Class<T> returnType, Object... arguments)
public <T> BaseProperty<T> operator(String operator, Class<T> returnType, BaseProperty<?>... arguments)
public <T> BaseProperty<T> operator(String operator, Class<T> returnType, Object... arguments)
Copyright © 2001–2021 Apache Cayenne. All rights reserved.