Package org.apache.cayenne.exp.property
Class NumericProperty<E extends Number>
java.lang.Object
org.apache.cayenne.exp.property.BaseProperty<E>
org.apache.cayenne.exp.property.NumericProperty<E>
- All Implemented Interfaces:
ComparableProperty<E>
,Property<E>
- Direct Known Subclasses:
NumericIdProperty
public class NumericProperty<E extends Number>
extends BaseProperty<E>
implements ComparableProperty<E>
Property that represents attributes mapped on numeric types
Numeric type is an any type inherited from Number
.
Provides basic math functions like mod(Number)
, abs()
and sqrt()
.
It is also implements ComparableProperty
interface.
- Since:
- 4.2
- See Also:
-
Field Summary
Fields inherited from class org.apache.cayenne.exp.property.BaseProperty
expressionSupplier, name, type
-
Constructor Summary
ModifierConstructorDescriptionprotected
NumericProperty
(String name, Expression expression, Class<E> type) Constructs a new property with the given name and expression -
Method Summary
Modifier and TypeMethodDescriptionabs()
add
(NumericProperty<?> value) Creates alias with different name for this propertyavg()
div
(NumericProperty<?> value) max()
min()
mod
(NumericProperty<?> number) mul
(NumericProperty<?> value) neg()
sqrt()
sub
(NumericProperty<?> value) sum()
Methods inherited from class org.apache.cayenne.exp.property.BaseProperty
asc, ascInsensitive, ascInsensitives, ascs, count, countDistinct, desc, descInsensitive, descInsensitives, descs, 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.Property
getAlias, getExpression, getName, getType
-
Constructor Details
-
NumericProperty
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
-
avg
- See Also:
-
sum
- See Also:
-
max
- Specified by:
max
in interfaceComparableProperty<E extends Number>
- See Also:
-
min
- Specified by:
min
in interfaceComparableProperty<E extends Number>
- See Also:
-
mod
- See Also:
-
mod
- See Also:
-
abs
- Returns:
- new property that represents abs() function call with current property as argument
- See Also:
-
sqrt
- Returns:
- new property that represents sqrt() function call with current property as argument
- See Also:
-
add
- Returns:
- new property that represents '+' operator with current property as argument
-
add
- Returns:
- new property that represents '+' operator with current property as argument
-
sub
- Returns:
- new property that represents '-' operator with current property as argument
-
sub
- Returns:
- new property that represents '-' operator with current property as argument
-
div
- Returns:
- new property that represents '/' operator with current property as argument
-
div
- Returns:
- new property that represents '/' operator with current property as argument
-
mul
- Returns:
- new property that represents '*' operator with current property as argument
-
mul
- Returns:
- new property that represents '*' operator with current property as argument
-
neg
- Returns:
- new property that represents negative value of current property
-
alias
Creates alias with different name for this property- Overrides:
alias
in classBaseProperty<E extends Number>
-
enclosing
- Overrides:
enclosing
in classBaseProperty<E extends Number>
- Returns:
- property that will be translated relative to parent query
-