Class FeatureValueCondition
java.lang.Object
de.hybris.platform.core.FlexibleSearchTranslatable
de.hybris.platform.core.GenericCondition
de.hybris.platform.catalog.jalo.classification.util.FeatureValueCondition
- All Implemented Interfaces:
Serializable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration determining if the range boundary we are querying for is the lower/upper. -
Constructor Summary
ConstructorsConstructorDescriptionFeatureValueCondition(ClassAttributeAssignment assignment, Language lang, String productTypeAlias, Operator operator, Object value) FeatureValueCondition(ClassAttributeAssignment assignment, Language lang, String productTypeAlias, Operator operator, Object value, FeatureValueCondition.RangeBoundary boundary) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringadjustString(String src) protected booleanprotected voidPerforms a plausablity check on current Operator.protected voidcheckValueType(Object singleValue) static FeatureValueConditioncontains(ClassAttributeAssignment assignment, String str) static FeatureValueConditionendsWith(ClassAttributeAssignment assignment, String str) static FeatureValueConditionequals(ClassAttributeAssignment assignment, Object value) static FeatureValueConditionequalsForRange(ClassAttributeAssignment assignment, Object value, FeatureValueCondition.RangeBoundary boundary) Returns all resetable key/value pairs already set in this condition or in one of its subconditions.getUnit()Returns the unit of the queried feature.getValidOperators(TypedFeature.FeatureType featureType) For the givenTypedFeature.FeatureType(e.g.static FeatureValueConditiongreater(ClassAttributeAssignment assignment, Object value) static FeatureValueConditiongreaterForRange(ClassAttributeAssignment assignment, Object value, FeatureValueCondition.RangeBoundary boundary) static FeatureValueConditionin(ClassAttributeAssignment assignment, Object... values) static FeatureValueConditionin(ClassAttributeAssignment assignment, Collection values) booleanTells whether or not string comparison should be done case insensitively.static FeatureValueConditionisNull(ClassAttributeAssignment assignment) static FeatureValueConditionless(ClassAttributeAssignment assignment, Object value) static FeatureValueConditionlessForRange(ClassAttributeAssignment assignment, Object value, FeatureValueCondition.RangeBoundary boundary) static FeatureValueConditionnotEquals(ClassAttributeAssignment assignment, Object value) static FeatureValueConditionnotNull(ClassAttributeAssignment assignment) protected booleanvoidsetCaseInsensitive(boolean insensitive) Changes whether or not string comparison should be done case insensitively.voidsetLanguage(Language lang) For localized features only: Allows to specify the value language explicitely - otherwise the session language would have been used.voidsetProductTypeAlias(String alias) Allows to specify the alias of the product type within the enclosing query.voidsetResettableValue(String key, Object value) Resets the value defined by given key.voidFor features with existing unit only: Changes the target unit of this condition.protected voidstatic FeatureValueConditionstartsWith(ClassAttributeAssignment assignment, String str) voidtoFlexibleSearch(StringBuilder query, Map<String, String> typeIndexMap, Map<String, Object> valueMap) EXISTS({{ SELECT {feat.PK} FROM {ProductFeature AS feat} WHERE {feat.product}={<itemAlias>.pk} AND {feat.classificationAttributeAssignment}='<assignmentPK>' AND {feat.stringValue|numberValue|booleanValue} = | <> | < | > | IN ?value }})protected voidwriteValue(StringBuilder query, Object singleValue, Map valueMap) Methods inherited from class de.hybris.platform.core.GenericCondition
and, and, caseSensitiveLike, caseSensitiveNotLike, contains, createConditionForFieldComparison, createConditionForFieldComparison, createConditionForLiteralComparison, createConditionForValueComparison, createConditionForValueComparison, createConditionForValueComparison, createConditionForValueComparison, createConditionList, createConditionList, createConditionList, createConditionList, createContainsCondition, createEndsWithCondition, createEqualCondition, createGreaterCondition, createGreaterOrEqualCondition, createIsNotNullCondition, createIsNullCondition, createJoinCondition, createLessCondition, createLessOrEqualCondition, createLikeCondition, createNotLikeCondition, createStartsWithCondition, createSubQueryCondition, createUnequalCondition, endsWith, equals, equals, getComparison, getComparison, getComparison, getComparison, getComparison, getComparison, getNotNull, getNull, getOperator, greater, greaterOrEqual, in, isTranslatableToPolyglotDialect, less, lessOrEqual, like, like, notEquals, notEquals, notIn, notLike, notLike, or, or, setOperator, startsWithMethods inherited from class de.hybris.platform.core.FlexibleSearchTranslatable
getAliasFromTypeMap, toPolyglotSearch
-
Constructor Details
-
FeatureValueCondition
public FeatureValueCondition(ClassAttributeAssignment assignment, Language lang, String productTypeAlias, Operator operator, Object value, FeatureValueCondition.RangeBoundary boundary) -
FeatureValueCondition
public FeatureValueCondition(ClassAttributeAssignment assignment, Language lang, String productTypeAlias, Operator operator, Object value)
-
-
Method Details
-
isNull
-
notNull
-
equals
-
equalsForRange
public static FeatureValueCondition equalsForRange(ClassAttributeAssignment assignment, Object value, FeatureValueCondition.RangeBoundary boundary) -
notEquals
-
greater
-
greaterForRange
public static FeatureValueCondition greaterForRange(ClassAttributeAssignment assignment, Object value, FeatureValueCondition.RangeBoundary boundary) -
less
-
lessForRange
public static FeatureValueCondition lessForRange(ClassAttributeAssignment assignment, Object value, FeatureValueCondition.RangeBoundary boundary) -
in
-
in
-
startsWith
-
endsWith
-
contains
-
checkValueType
-
setLanguage
For localized features only: Allows to specify the value language explicitely - otherwise the session language would have been used. -
getLanguage
-
getUnit
Returns the unit of the queried feature. If a unit is present the statement will convert all values of other units into this unit to allow comparation. -
setUnit
For features with existing unit only: Changes the target unit of this condition. Only convertible units of the configured unit are allowed. -
setProductTypeAlias
Allows to specify the alias of the product type within the enclosing query.This is always necessary when the product type is not the initial type of the enclosing query!
-
getProductTypeAlias
-
setCaseInsensitive
public void setCaseInsensitive(boolean insensitive) Changes whether or not string comparison should be done case insensitively. -
isCaseInsensitive
public boolean isCaseInsensitive()Tells whether or not string comparison should be done case insensitively. -
getFeatureField
-
canCompareEnumValue
protected boolean canCompareEnumValue() -
setValue
-
checkOperator
protected void checkOperator()Description copied from class:GenericConditionPerforms a plausablity check on current Operator. Throws aIllegalArgumentException, if check fails.- Specified by:
checkOperatorin classGenericCondition
-
getResettableValues
Description copied from class:GenericConditionReturns all resetable key/value pairs already set in this condition or in one of its subconditions.- Specified by:
getResettableValuesin classGenericCondition- Returns:
- Map A map containing all resettable key/value pairs.
-
setResettableValue
Description copied from class:GenericConditionResets the value defined by given key.- Specified by:
setResettableValuein classGenericCondition- Parameters:
key- original key for value parametervalue- a new Value
-
requiresOrder
protected boolean requiresOrder() -
toFlexibleSearch
public void toFlexibleSearch(StringBuilder query, Map<String, String> typeIndexMap, Map<String, Object> valueMap) EXISTS({{ SELECT {feat.PK} FROM {ProductFeature AS feat} WHERE {feat.product}={<itemAlias>.pk} AND {feat.classificationAttributeAssignment}='<assignmentPK>' AND {feat.stringValue|numberValue|booleanValue} = | <> | < | > | IN ?value }})- Specified by:
toFlexibleSearchin classFlexibleSearchTranslatable- Parameters:
query- contains the querytypeIndexMap- contains typeCode <> typeIndex mappingsvalueMap- contains valueQualifier <> value mappings
-
adjustString
-
writeValue
-
getValidOperators
For the givenTypedFeature.FeatureType(e.g. FeatureType.STRING) this will return a set of validOperators.- Returns:
- a Set of Operators which are valid for the given FeatureType
-