Class DefaultRuleDao
java.lang.Object
de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
de.hybris.platform.ruleengineservices.rule.dao.impl.DefaultRuleDao
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final StringFields inherited from class de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
flexibleSearchService, modelService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringBuildercreateSelectStatement(String typecode) protected <T extends AbstractRuleModel>
List<T>filterByLastVersion(List<T> rulesWithVersion) <T extends AbstractRuleModel>
List<T>Finds all activeAbstractRuleModels<T extends AbstractRuleModel>
List<T>findAllActiveRulesByType(Class<T> type) Finds all active rules by a specified type<T extends AbstractRuleModel>
List<T>Finds all rules with latest version<T extends AbstractRuleModel>
List<T>findAllRulesByType(Class<T> type) Finds all rules by a specified type<T extends AbstractRuleModel>
List<T>findAllRulesWithStatuses(RuleStatus... ruleStatuses) Return all rule versions with one of the statuses listed in ruleStatuses param<T extends AbstractRuleModel>
List<T>Finds all versions ofAbstractRuleModelby code.<T extends AbstractRuleModel>
List<T>findAllRuleVersionsByCodeAndStatus(String code, RuleStatus ruleStatus) Return all rule versions with a given code and status<T extends AbstractRuleModel>
List<T>findAllRuleVersionsByCodeAndStatuses(String code, RuleStatus... ruleStatuses) Return all rule versions with a given code and one of the statuses listed in ruleStatuses param.<T extends AbstractRuleModel>
List<T>findByVersionAndStatuses(Long version, RuleStatus... ruleStatuses) Return all rules within statuses and versionfindEngineRuleTypeByRuleType(Class<?> type) Finds engine rule type for given rule type.<T extends AbstractRuleModel>
TfindRuleByCode(String code) Finds the latest version ofAbstractRuleModelby code.findRuleByCodeAndStatus(String code, RuleStatus ruleStatus) Return a rule, having latest version with the status<T extends AbstractRuleModel>
TfindRuleByCodeAndType(String code, Class<T> type) FindsAbstractRuleModelby code.findRuleByCodeAndVersion(String code, Long version) Return a rule with a specified versionprotected I18NServicegetRuleVersion(String code) Return the last version of a rule with a given codeprotected TypeServicevoidsetI18NService(I18NService i18NService) voidsetTypeService(TypeService typeService) Methods inherited from class de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
getAllSources, getFlexibleSearchService, getModelService, getSource, load, loadAll, search, search, searchUnique, setFlexibleSearchService, setModelService
-
Field Details
-
GET_ALL_RULES_QUERY
- See Also:
-
GET_ALL_ACTIVE_RULES_QUERY
- See Also:
-
GET_RULE_BY_CODE
- See Also:
-
GET_ENGINE_RULE_TYPE_FOR_RULE_TYPE
- See Also:
-
GET_MAX_VERSION_FOR_CODE
- See Also:
-
GET_RULE_BY_CODE_STATUS
- See Also:
-
GET_RULE_BY_CODE_STATUSES
- See Also:
-
GET_RULE_BY_STATUSES
- See Also:
-
GET_RULE_BY_CODE_VERSION
- See Also:
-
GET_RULE_BY_STATUS_AND_VERSION
- See Also:
-
-
Constructor Details
-
DefaultRuleDao
public DefaultRuleDao()
-
-
Method Details
-
findAllRules
Description copied from interface:RuleDaoFinds all rules with latest version- Specified by:
findAllRulesin interfaceRuleDao- Returns:
- List of
AbstractRuleModels
-
findAllRulesByType
Description copied from interface:RuleDaoFinds all rules by a specified type- Specified by:
findAllRulesByTypein interfaceRuleDao- Parameters:
type- - type of the rule. Must extendAbstractRuleModel- Returns:
- list of all rules of specified type
-
findAllActiveRules
Description copied from interface:RuleDaoFinds all activeAbstractRuleModels- Specified by:
findAllActiveRulesin interfaceRuleDao- Returns:
- List of
AbstractRuleModels
-
findAllActiveRulesByType
Description copied from interface:RuleDaoFinds all active rules by a specified type- Specified by:
findAllActiveRulesByTypein interfaceRuleDao- Parameters:
type- - type of the rule. Must extendAbstractRuleModel- Returns:
- list of all active rules of specified type
-
findRuleByCode
Description copied from interface:RuleDaoFinds the latest version ofAbstractRuleModelby code.- Specified by:
findRuleByCodein interfaceRuleDao- Parameters:
code- - code of the rule- Returns:
- a rule, extending
AbstractRuleModelor null if not found
-
findAllRuleVersionsByCode
Description copied from interface:RuleDaoFinds all versions ofAbstractRuleModelby code.- Specified by:
findAllRuleVersionsByCodein interfaceRuleDao- Parameters:
code- - code of the rule- Returns:
- list of rules, extending
AbstractRuleModel
-
findRuleByCodeAndType
Description copied from interface:RuleDaoFindsAbstractRuleModelby code.- Specified by:
findRuleByCodeAndTypein interfaceRuleDao- Parameters:
code- - code of the ruletype- - type of the rule. Must extendAbstractRuleModel- Returns:
AbstractRuleModel
-
findEngineRuleTypeByRuleType
Description copied from interface:RuleDaoFinds engine rule type for given rule type.- Specified by:
findEngineRuleTypeByRuleTypein interfaceRuleDao- Parameters:
type- - type of the rule.- Returns:
- RuleType of the engine rule
-
getRuleVersion
Description copied from interface:RuleDaoReturn the last version of a rule with a given code- Specified by:
getRuleVersionin interfaceRuleDao- Parameters:
code- the Rule code- Returns:
- last version number of a rule. Null if not found
-
findRuleByCodeAndStatus
Description copied from interface:RuleDaoReturn a rule, having latest version with the status- Specified by:
findRuleByCodeAndStatusin interfaceRuleDao- Parameters:
code- the Rule coderuleStatus- the rule status- Returns:
- an optional of the rule with latest version with the specified status
-
findAllRuleVersionsByCodeAndStatus
public <T extends AbstractRuleModel> List<T> findAllRuleVersionsByCodeAndStatus(String code, RuleStatus ruleStatus) Description copied from interface:RuleDaoReturn all rule versions with a given code and status- Specified by:
findAllRuleVersionsByCodeAndStatusin interfaceRuleDao- Parameters:
code- the Rule coderuleStatus- the rule status- Returns:
- list of rules extending
AbstractRuleModel
-
findAllRuleVersionsByCodeAndStatuses
public <T extends AbstractRuleModel> List<T> findAllRuleVersionsByCodeAndStatuses(String code, RuleStatus... ruleStatuses) Description copied from interface:RuleDaoReturn all rule versions with a given code and one of the statuses listed in ruleStatuses param. If no status is provided, the method fallback toRuleDao.findAllRuleVersionsByCode(String)- Specified by:
findAllRuleVersionsByCodeAndStatusesin interfaceRuleDao- Parameters:
code- the Rule coderuleStatuses- the rule status array- Returns:
- list of rules extending
AbstractRuleModel
-
findAllRulesWithStatuses
Description copied from interface:RuleDaoReturn all rule versions with one of the statuses listed in ruleStatuses param- Specified by:
findAllRulesWithStatusesin interfaceRuleDao- Parameters:
ruleStatuses- the rule status array- Returns:
- list of rules extending
AbstractRuleModel
-
findByVersionAndStatuses
public <T extends AbstractRuleModel> List<T> findByVersionAndStatuses(Long version, RuleStatus... ruleStatuses) Description copied from interface:RuleDaoReturn all rules within statuses and version- Specified by:
findByVersionAndStatusesin interfaceRuleDao- Parameters:
version- the rule versionruleStatuses- the rule statuses- Returns:
- list of rules extending
AbstractRuleModel
-
findRuleByCodeAndVersion
Description copied from interface:RuleDaoReturn a rule with a specified version- Specified by:
findRuleByCodeAndVersionin interfaceRuleDao- Parameters:
code- the Rule codeversion- the version number- Returns:
- an optional of the rule with code and version
-
createSelectStatement
-
filterByLastVersion
-
getI18NService
-
setI18NService
-
getTypeService
-
setTypeService
-