Package org.apache.cayenne.exp
Class Property<E>
java.lang.Object
org.apache.cayenne.exp.property.BaseProperty<E>
org.apache.cayenne.exp.Property<E>
- Type Parameters:
E
- The type this property returns.
- All Implemented Interfaces:
ComparableProperty<E>
,PathProperty<E>
,Property<E>
,RelationshipProperty<E>
@Deprecated
public class Property<E>
extends BaseProperty<E>
implements ComparableProperty<E>, RelationshipProperty<E>
Deprecated.
A property in a DataObject
.
Used to construct Expressions quickly and with type-safety, and to construct Orderings.
Instances of this class are immutable.
Must be created via factory methods Property.create(..)
- Since:
- 4.0
- See Also:
-
Field Summary
Fields inherited from class org.apache.cayenne.exp.property.BaseProperty
expressionSupplier, name, type
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabs()
Deprecated.Deprecated.Creates alias with different name for this propertyavg()
Deprecated.Deprecated.Arguments will be converted as follows: if argument is aProperty
than its expression will be used if argument is aExpression
than it will be used as is all other values will be converted to StringDeprecated.Creates an expression for a database "LIKE" query with the value converted to a pattern matching anywhere in the String.containsIgnoreCase
(String value) Deprecated.Same ascontains(String)
, only using case-insensitive comparison.static <T> Property
<T> Deprecated.Creates property with name and typestatic <T> Property
<T> create
(String name, Expression expression, Class<? super T> type) Deprecated.Creates property with name, expression and typestatic <T> Property
<T> create
(Expression expression, Class<? super T> type) Deprecated.Creates property with expression and typestatic <T extends Persistent>
Property<T> createSelf
(Class<? super T> type) Deprecated.Creates "self" Property for persistent class.Deprecated.Constructs a property path by appending the argument to the existing property separated by a dot.<T> Property
<T> Deprecated.Deprecated.Creates an expression for a database "LIKE" query with the value converted to a pattern matching the tail of a String.endsWithIgnoreCase
(String value) Deprecated.Same asendsWith(String)
, only using case-insensitive comparison.<T extends Persistent>
Property<T> Deprecated.Create new "flat" property for toMany relationship.length()
Deprecated.Deprecated.Deprecated.likeIgnoreCase
(String pattern) Deprecated.Deprecated.Deprecated.lower()
Deprecated.max()
Deprecated.min()
Deprecated.Deprecated.Deprecated.nlikeIgnoreCase
(String value) Deprecated.outer()
Deprecated.Returns a version of this property that represents an OUTER join.sqrt()
Deprecated.startsWith
(String value) Deprecated.Creates an expression for a database "LIKE" query with the value converted to a pattern matching the beginning of a String.startsWithIgnoreCase
(String value) Deprecated.Same asstartsWith(String)
, only using case-insensitive comparison.substring
(int offset, int length) Deprecated.sum()
Deprecated.trim()
Deprecated.upper()
Deprecated.Methods inherited from class org.apache.cayenne.exp.property.BaseProperty
asc, ascInsensitive, ascInsensitives, ascs, count, countDistinct, desc, descInsensitive, descInsensitives, descs, enclosing, eq, eq, equals, function, function, getAlias, getExpression, getFrom, getFromAll, getName, getType, hashCode, in, in, in, isFalse, isNotNull, isNull, isTrue, ne, ne, nin, nin, nin, operator, operator, path, setIn, setInAll
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.cayenne.exp.property.ComparableProperty
between, between, gt, gt, gte, gte, lt, lt, lte, lte
Methods inherited from interface org.apache.cayenne.exp.property.PathProperty
dot, dot, dot, dot
Methods inherited from interface org.apache.cayenne.exp.property.Property
getAlias, getExpression, getName, getType
-
Field Details
-
COUNT
Deprecated.since 4.2 usePropertyFactory.COUNT
Property that can be used in COUNT(*) queries
List<Object[]> result = ObjectSelect .columnQuery(Artist.class, Property.COUNT, Artist.ARTIST_NAME) .having(Property.COUNT.gt(1L)) .select(context);
-
-
Constructor Details
-
Property
Deprecated.Constructs a new property with the given name and type.- Parameters:
name
- of the property (usually it's obj path)type
- of the property- See Also:
-
Property
Deprecated.Constructs a new property with the given name and expression- Parameters:
name
- of the property (will be used as alias for the expression)expression
- expression for propertytype
- of the property- See Also:
-
-
Method Details
-
like
Deprecated.- Parameters:
pattern
- a pattern matching property value. Pattern may include "_" and "%" wildcard symbols to match any single character or a sequence of characters. To prevent "_" and "%" from being treated as wildcards, they need to be escaped and escape char passed withlike(String, char)
method.- Returns:
- An expression for a Database "LIKE" query.
-
like
Deprecated.- Parameters:
pattern
- a properly escaped pattern matching property value. Pattern may include "_" and "%" wildcard symbols to match any single character or a sequence of characters.escapeChar
- an escape character used in the pattern to escape "%" and "_".- Returns:
- An expression for a Database "LIKE" query.
-
likeIgnoreCase
Deprecated.- Returns:
- An expression for a case insensitive "LIKE" query.
-
nlike
Deprecated.- Returns:
- An expression for a Database "NOT LIKE" query.
-
nlikeIgnoreCase
Deprecated.- Returns:
- An expression for a case insensitive "NOT LIKE" query.
-
contains
Deprecated.Creates an expression for a database "LIKE" query with the value converted to a pattern matching anywhere in the String.- Parameters:
substring
- a String to match against property value. "_" and "%" symbols are NOT treated as wildcards and are escaped when converted to a LIKE expression.- Returns:
- a newly created expression.
-
startsWith
Deprecated.Creates an expression for a database "LIKE" query with the value converted to a pattern matching the beginning of a String.- Parameters:
value
- a String to match against property value. "_" and "%" symbols are NOT treated as wildcards and are escaped when converted to a LIKE expression.- Returns:
- a newly created expression.
-
endsWith
Deprecated.Creates an expression for a database "LIKE" query with the value converted to a pattern matching the tail of a String.- Parameters:
value
- a String to match against property value. "_" and "%" symbols are NOT treated as wildcards and are escaped when converted to a LIKE expression.- Returns:
- a newly created expression.
-
containsIgnoreCase
Deprecated.Same ascontains(String)
, only using case-insensitive comparison. -
startsWithIgnoreCase
Deprecated.Same asstartsWith(String)
, only using case-insensitive comparison. -
endsWithIgnoreCase
Deprecated.Same asendsWith(String)
, only using case-insensitive comparison. -
length
Deprecated.- See Also:
-
locate
Deprecated.- See Also:
-
locate
Deprecated.- See Also:
-
trim
Deprecated.- See Also:
-
upper
Deprecated.- See Also:
-
lower
Deprecated.- See Also:
-
concat
Deprecated.Arguments will be converted as follows:
- if argument is a
Property
than its expression will be used - if argument is a
Expression
than it will be used as is - all other values will be converted to String
Usage:
Property<String> fullName = Artist.FIRST_NAME.concat(" ", Artist.SECOND_NAME);
- See Also:
- if argument is a
-
substring
Deprecated.- See Also:
-
avg
Deprecated.- See Also:
-
sum
Deprecated.- See Also:
-
mod
Deprecated.- See Also:
-
abs
Deprecated.- See Also:
-
sqrt
Deprecated.- See Also:
-
flat
Deprecated.Create new "flat" property for toMany relationship.
Example:
List<Object[]> result = ObjectSelect .columnQuery(Artist.class, Artist.ARTIST_NAME, Artist.PAINTING_ARRAY.flat(Painting.class)) .select(context);
-
alias
Deprecated.Creates alias with different name for this property- Overrides:
alias
in classBaseProperty<E>
-
outer
Deprecated.Description copied from interface:RelationshipProperty
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.- Specified by:
outer
in interfaceRelationshipProperty<E>
-
dot
Deprecated. -
dot
Deprecated.Constructs a property path by appending the argument to the existing property separated by a dot.- Specified by:
dot
in interfacePathProperty<E>
- Returns:
- a newly created Property object.
-
max
Deprecated.- Specified by:
max
in interfaceComparableProperty<E>
- See Also:
-
min
Deprecated.- Specified by:
min
in interfaceComparableProperty<E>
- See Also:
-
create
Deprecated.Creates property with name and type- See Also:
-
create
Deprecated.Creates property with expression and type- See Also:
-
create
Deprecated.Creates property with name, expression and type- See Also:
-
createSelf
Deprecated.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)
Here is sample code, that will select all Artists and count of their Paintings:
Property<Artist> artistFull = Property.createSelf(Artist.class); List<Object[]> result = ObjectSelect .columnQuery(Artist.class, artistFull, Artist.PAINTING_ARRAY.count()) .select(context);
-
PropertyFactory
andorg.apache.cayenne.exp.property
package.