Package io.jmix.core.querycondition
Class PropertyCondition
java.lang.Object
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. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the condition if 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
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
Creates "!=" condition.static PropertyCondition
Creates a condition that is translated to "not in".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()
-
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". -
getProperty
-
setProperty
-
getOperation
-
setOperation
-
getParameterName
-
setParameterName
-
getParameterValue
-
setParameterValue
-
getParameters
Description copied from interface:Condition
Returns parameters specified in the condition.- Specified by:
getParameters
in interfaceCondition
-
actualize
Description copied from interface:Condition
Returns the condition if the argument contains all parameters specified in the condition. -
toString
-
copy
Description copied from interface:Condition
Returns a deep copy of this condition. -
getExcludedParameters
- Specified by:
getExcludedParameters
in interfaceCondition
-