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
Nested ClassesModifier and TypeClassDescriptionstatic classString constants defining comparison operations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the condition if the argument contains all parameters specified in the condition.static PropertyConditionCreates a condition that is translated to "like %value%".copy()Returns a deep copy of this condition.static PropertyConditionCreates a condition to compare the property with the given value.static PropertyConditioncreateWithParameterName(String property, String operation, String parameterName) Creates property condition with the specified parameter name.static PropertyConditioncreateWithValue(String property, String operation, Object parameterValue) Creates a condition to compare the property with the provided value.static PropertyConditionCreates a condition that is translated to "like %value".static PropertyConditionCreates "=" condition.getExcludedParameters(Set<String> actualParameters) Returns parameters specified in the condition.static PropertyConditionCreates ">" condition.static PropertyConditiongreaterOrEqual(String property, Object value) Creates ">=" condition.static PropertyConditionCreates a condition that is translated to "in".static PropertyConditionCreates a condition that is translated to "is null" or "is not null" depending on the parameter value.static PropertyConditionCreates "<" condition.static PropertyConditionlessOrEqual(String property, Object value) Creates "<=" condition.static PropertyConditionCreates "!=" condition.static PropertyConditionCreates a condition that is translated to "not in".voidsetOperation(String operation) voidsetParameterName(String parameterName) voidsetParameterValue(Object parameterValue) voidsetProperty(String property) static PropertyConditionstartsWith(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.OperationconstantsparameterName- 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.Operationconstants.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.Operationvalue- 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:ConditionReturns parameters specified in the condition.- Specified by:
getParametersin interfaceCondition
-
actualize
Description copied from interface:ConditionReturns the condition if the argument contains all parameters specified in the condition. -
toString
-
copy
Description copied from interface:ConditionReturns a deep copy of this condition. -
getExcludedParameters
- Specified by:
getExcludedParametersin interfaceCondition
-