Package io.jmix.core.querycondition
Class PropertyCondition
java.lang.Object
io.jmix.core.querycondition.SkippableCondition<PropertyCondition>
io.jmix.core.querycondition.PropertyCondition
- All Implemented Interfaces:
Condition
,Serializable
Condition for filtering by entity property.
Use one of the static methods like equal(String, Object)
, greater(String, Object)
to create
property conditions.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
String constants defining comparison operations. -
Field Summary
Fields inherited from class io.jmix.core.querycondition.SkippableCondition
skipNullOrEmpty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionChecks whether the argument contains all parameters specified in the condition.static PropertyCondition
Creates a condition that is translated to "like %value%".copy()
Returns a deep copy of this condition.static PropertyCondition
Creates a condition to compare the property with the given value.static PropertyCondition
createWithParameterName
(String property, String operation, String parameterName) Creates property condition with the specified parameter name.static PropertyCondition
createWithValue
(String property, String operation, Object parameterValue) Creates a condition to compare the property with the provided value.static PropertyCondition
Creates a condition that is translated to "like %value".static PropertyCondition
Creates "=" condition.getExcludedParameters
(Set<String> actualParameters) Returns parameters specified in the condition.static PropertyCondition
Creates ">" condition.static PropertyCondition
greaterOrEqual
(String property, Object value) Creates ">=" condition.static PropertyCondition
Creates a condition that is translated to "in".static PropertyCondition
isCollectionEmpty
(String property, Object value) Creates a condition that is translated to "is empty" or "is not empty" depending on the parameter value.static PropertyCondition
Creates a condition that is translated to "is null" or "is not null" depending on the parameter value.static PropertyCondition
Creates "<" condition.static PropertyCondition
lessOrEqual
(String property, Object value) Creates "<=" condition.static PropertyCondition
memberOfCollection
(String property, Object value) Creates a condition that is translated to "member of".static PropertyCondition
Creates "!=" condition.static PropertyCondition
Creates a condition that is translated to "not in".static PropertyCondition
notMemberOfCollection
(String property, Object value) Creates a condition that is translated to "not member of".void
setOperation
(String operation) void
setParameterName
(String parameterName) void
setParameterValue
(Object parameterValue) void
setProperty
(String property) static PropertyCondition
startsWith
(String property, Object value) Creates a condition that is translated to "like value%".toString()
Methods inherited from class io.jmix.core.querycondition.SkippableCondition
applyDefaultSkipNullOrEmpty, isSkipNullOrEmpty, setSkipNullOrEmpty, skipNullOrEmpty
-
Constructor Details
-
PropertyCondition
public PropertyCondition()
-
-
Method Details
-
createWithParameterName
public static PropertyCondition createWithParameterName(String property, String operation, String parameterName) Creates property condition with the specified parameter name. The parameter value must be provided by callingsetParameterValue(Object)
method.- Parameters:
property
- entity attribute nameoperation
- comparison operation, seePropertyCondition.Operation
constantsparameterName
- parameter name
-
createWithValue
public static PropertyCondition createWithValue(String property, String operation, Object parameterValue) Creates a condition to compare the property with the provided value. A parameter name is generated based on the property name.- Parameters:
property
- entity attribute nameoperation
- comparison operation, seePropertyCondition.Operation
constants.parameterValue
- value to compare with
-
create
Creates a condition to compare the property with the given value.- Parameters:
property
- entity attribute nameoperation
- comparison operation, see constants inPropertyCondition.Operation
value
- value to compare with
-
equal
Creates "=" condition. -
notEqual
Creates "!=" condition. -
greater
Creates ">" condition. -
greaterOrEqual
Creates ">=" condition. -
less
Creates "<" condition. -
lessOrEqual
Creates "<=" condition. -
contains
Creates a condition that is translated to "like %value%". -
startsWith
Creates a condition that is translated to "like value%". -
endsWith
Creates a condition that is translated to "like %value". -
isSet
Creates a condition that is translated to "is null" or "is not null" depending on the parameter value. -
inList
Creates a condition that is translated to "in". -
notInList
Creates a condition that is translated to "not in". -
isCollectionEmpty
Creates a condition that is translated to "is empty" or "is not empty" depending on the parameter value. -
memberOfCollection
Creates a condition that is translated to "member of". -
notMemberOfCollection
Creates a condition that is translated to "not member of". -
getProperty
-
setProperty
-
getOperation
-
setOperation
-
getParameterName
-
setParameterName
-
getParameterValue
-
setParameterValue
-
getParameters
Description copied from interface:Condition
Returns parameters specified in the condition. -
actualize
Description copied from interface:Condition
Checks whether the argument contains all parameters specified in the condition.defaultSkipNullOrEmpty
- default value forSkippableCondition.skipNullOrEmpty
, should be obtained usingCoreProperties.isSkipNullOrEmptyConditionsByDefault()
- Returns:
- the condition if
SkippableCondition.skipNullOrEmpty
isfalse
or ifactualParameters
contains all parameters specified in the condition and these parameters are not null or empty. Otherwise returnsnull
.
-
toString
-
copy
Description copied from interface:Condition
Returns a deep copy of this condition. -
getExcludedParameters
-