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
Nested ClassesModifier and TypeClassDescriptionstatic classString constants defining comparison operations. -
Field Summary
Fields inherited from class io.jmix.core.querycondition.SkippableCondition
skipNullOrEmpty -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionChecks whether 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 PropertyConditionisCollectionEmpty(String property, Object value) Creates a condition that is translated to "is empty" or "is not empty" depending on the parameter value.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 PropertyConditionmemberOfCollection(String property, Object value) Creates a condition that is translated to "member of".static PropertyConditionCreates "!=" condition.static PropertyConditionCreates a condition that is translated to "not in".static PropertyConditionnotMemberOfCollection(String property, Object value) Creates a condition that is translated to "not member of".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()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.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". -
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:ConditionReturns parameters specified in the condition. -
actualize
Description copied from interface:ConditionChecks 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.skipNullOrEmptyisfalseor ifactualParameterscontains all parameters specified in the condition and these parameters are not null or empty. Otherwise returnsnull.
-
toString
-
copy
Description copied from interface:ConditionReturns a deep copy of this condition. -
getExcludedParameters
-