Class DefaultPromotionSourceRuleDao
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
-
- de.hybris.platform.promotionengineservices.dao.impl.DefaultPromotionSourceRuleDao
-
- All Implemented Interfaces:
PromotionSourceRuleDao,Dao
public class DefaultPromotionSourceRuleDao extends AbstractItemDao implements PromotionSourceRuleDao
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringEXCLUDE_CAT_WHEREprotected static java.lang.StringEXCLUDE_NULL_PRODUCT_PROMOTIONSprotected static java.lang.StringEXCLUDE_NULL_RESULTS_PROMOTIONSprotected static java.lang.StringEXCLUDE_PRODUCTS_WHEREprotected static java.lang.StringFILTER_BY_RULE_AND_MODULE_NAMEprotected static java.lang.StringFIND_PROMOTIONS_CAT_QUERYprotected static java.lang.StringFIND_PROMOTIONS_CAT_SELECTprotected static java.lang.StringFIND_PROMOTIONS_CAT_WHEREprotected static java.lang.StringFIND_PROMOTIONS_COMB_CAT_QUERYprotected static java.lang.StringFIND_PROMOTIONS_PROD_QUERYprotected static java.lang.StringFIND_PROMOTIONS_PROD_SELECTprotected static java.lang.StringFIND_PROMOTIONS_PROD_WHEREprotected static java.lang.StringFIND_PROMOTIONS_SELECTprotected static java.lang.StringFIND_PROMOTIONS_UNION1protected static java.lang.StringFIND_PROMOTIONS_UNION2protected static java.lang.StringFIND_PROMOTIONS_UNION3protected static java.lang.StringFIND_PROMOTIONS_WHERE1protected static java.lang.StringFIND_PROMOTIONS_WHERE2protected static java.lang.StringFIND_PROMOTIONS_WITHIN_START_END_DATESprotected static java.lang.StringFIND_PUBLISHED_PROMOTIONSprotected static java.lang.StringGET_ALL_CATEGORIES_FOR_RULEprotected static java.lang.StringGET_ALL_CATEGORIES_FOR_RULE_AND_MODULEprotected static java.lang.StringGET_ALL_COMBINED_CATS_FOR_RULEprotected static java.lang.StringGET_ALL_COMBINED_CATS_FOR_RULE_AND_MODULEprotected static java.lang.StringGET_ALL_EXCLUDED_CATEGORIES_FOR_RULEprotected static java.lang.StringGET_ALL_EXCLUDED_CATEGORIES_FOR_RULE_AND_MODULEprotected static java.lang.StringGET_ALL_EXCLUDED_PRODUCTS_FOR_RULEprotected static java.lang.StringGET_ALL_EXCLUDED_PRODUCTS_FOR_RULE_AND_MODULEprotected static java.lang.StringGET_ALL_PRODUCTS_FOR_RULEprotected static java.lang.StringGET_ALL_PRODUCTS_FOR_RULE_AND_MODULEprotected static java.lang.StringGET_LAST_CONDITIONID_FOR_RULEprotected static java.lang.StringRULE_CODE_PARAM-
Fields inherited from class de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
flexibleSearchService, modelService
-
-
Constructor Summary
Constructors Constructor Description DefaultPromotionSourceRuleDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<CatForPromotionSourceRuleModel>findAllCatForPromotionSourceRule(PromotionSourceRuleModel rule, java.lang.String baseName)Get all CatForPromotionSourceRuleModels for given promotion source rule and module namejava.util.List<CombinedCatsForRuleModel>findAllCombinedCatsForRule(PromotionSourceRuleModel rule, java.lang.String baseName)Get all CombinedCatsForRuleModels for given promotion source rule.java.util.List<ExcludedCatForRuleModel>findAllExcludedCatForPromotionSourceRule(PromotionSourceRuleModel rule, java.lang.String baseName)Get all ExcludedCatForRuleModels for given promotion source rule.java.util.List<ExcludedProductForRuleModel>findAllExcludedProductForPromotionSourceRule(PromotionSourceRuleModel rule, java.lang.String baseName)Get all ExcludedProductForRuleModel for given promotion source rule.java.util.List<ProductForPromotionSourceRuleModel>findAllProductForPromotionSourceRule(PromotionSourceRuleModel rule, java.lang.String baseName)Get all ProductForPromotionSourceRuleModels for given promotion source rule and module name.java.lang.IntegerfindLastConditionIdForRule(PromotionSourceRuleModel rule)Get max conditionId in CombinedCatsForRule for one rule.java.util.List<RuleBasedPromotionModel>findPromotions(java.util.Collection<PromotionGroupModel> promotionGroups, java.lang.String productCode, java.util.Set<java.lang.String> categoryCodes)Finds RuleBasedPromotionModels for given product code and category codes (but will exclude all rules for which the correspondingPromotionSourceRuleModel.getExcludeFromStorefrontDisplay()is set totrueOR current date is out ofAbstractRuleModel.getStartDate(),AbstractRuleModel.getEndDate()date range OR the rule statusAbstractRuleModel.getStatus()is not PUBLISHED).protected java.util.List<RuleBasedPromotionModel>findPromotions(java.util.Collection<PromotionGroupModel> promotionGroups, java.lang.String productCode, java.util.Set<java.lang.String> categoryCodes, java.util.Date currentDate)-
Methods inherited from class de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
getAllSources, getFlexibleSearchService, getModelService, getSource, load, loadAll, search, search, searchUnique, setFlexibleSearchService, setModelService
-
-
-
-
Field Detail
-
FILTER_BY_RULE_AND_MODULE_NAME
protected static final java.lang.String FILTER_BY_RULE_AND_MODULE_NAME
- See Also:
- Constant Field Values
-
GET_ALL_PRODUCTS_FOR_RULE
protected static final java.lang.String GET_ALL_PRODUCTS_FOR_RULE
- See Also:
- Constant Field Values
-
GET_ALL_PRODUCTS_FOR_RULE_AND_MODULE
protected static final java.lang.String GET_ALL_PRODUCTS_FOR_RULE_AND_MODULE
- See Also:
- Constant Field Values
-
GET_ALL_CATEGORIES_FOR_RULE
protected static final java.lang.String GET_ALL_CATEGORIES_FOR_RULE
- See Also:
- Constant Field Values
-
GET_ALL_CATEGORIES_FOR_RULE_AND_MODULE
protected static final java.lang.String GET_ALL_CATEGORIES_FOR_RULE_AND_MODULE
- See Also:
- Constant Field Values
-
GET_ALL_EXCLUDED_CATEGORIES_FOR_RULE
protected static final java.lang.String GET_ALL_EXCLUDED_CATEGORIES_FOR_RULE
- See Also:
- Constant Field Values
-
GET_ALL_EXCLUDED_CATEGORIES_FOR_RULE_AND_MODULE
protected static final java.lang.String GET_ALL_EXCLUDED_CATEGORIES_FOR_RULE_AND_MODULE
- See Also:
- Constant Field Values
-
GET_ALL_EXCLUDED_PRODUCTS_FOR_RULE
protected static final java.lang.String GET_ALL_EXCLUDED_PRODUCTS_FOR_RULE
- See Also:
- Constant Field Values
-
GET_ALL_EXCLUDED_PRODUCTS_FOR_RULE_AND_MODULE
protected static final java.lang.String GET_ALL_EXCLUDED_PRODUCTS_FOR_RULE_AND_MODULE
- See Also:
- Constant Field Values
-
GET_ALL_COMBINED_CATS_FOR_RULE
protected static final java.lang.String GET_ALL_COMBINED_CATS_FOR_RULE
- See Also:
- Constant Field Values
-
GET_ALL_COMBINED_CATS_FOR_RULE_AND_MODULE
protected static final java.lang.String GET_ALL_COMBINED_CATS_FOR_RULE_AND_MODULE
- See Also:
- Constant Field Values
-
GET_LAST_CONDITIONID_FOR_RULE
protected static final java.lang.String GET_LAST_CONDITIONID_FOR_RULE
- See Also:
- Constant Field Values
-
FIND_PROMOTIONS_SELECT
protected static final java.lang.String FIND_PROMOTIONS_SELECT
- See Also:
- Constant Field Values
-
FIND_PROMOTIONS_WHERE1
protected static final java.lang.String FIND_PROMOTIONS_WHERE1
- See Also:
- Constant Field Values
-
FIND_PROMOTIONS_WHERE2
protected static final java.lang.String FIND_PROMOTIONS_WHERE2
- See Also:
- Constant Field Values
-
FIND_PROMOTIONS_WITHIN_START_END_DATES
protected static final java.lang.String FIND_PROMOTIONS_WITHIN_START_END_DATES
- See Also:
- Constant Field Values
-
FIND_PUBLISHED_PROMOTIONS
protected static final java.lang.String FIND_PUBLISHED_PROMOTIONS
- See Also:
- Constant Field Values
-
FIND_PROMOTIONS_PROD_SELECT
protected static final java.lang.String FIND_PROMOTIONS_PROD_SELECT
- See Also:
- Constant Field Values
-
FIND_PROMOTIONS_PROD_WHERE
protected static final java.lang.String FIND_PROMOTIONS_PROD_WHERE
- See Also:
- Constant Field Values
-
FIND_PROMOTIONS_CAT_SELECT
protected static final java.lang.String FIND_PROMOTIONS_CAT_SELECT
- See Also:
- Constant Field Values
-
FIND_PROMOTIONS_CAT_WHERE
protected static final java.lang.String FIND_PROMOTIONS_CAT_WHERE
- See Also:
- Constant Field Values
-
FIND_PROMOTIONS_COMB_CAT_QUERY
protected static final java.lang.String FIND_PROMOTIONS_COMB_CAT_QUERY
- See Also:
- Constant Field Values
-
EXCLUDE_PRODUCTS_WHERE
protected static final java.lang.String EXCLUDE_PRODUCTS_WHERE
- See Also:
- Constant Field Values
-
EXCLUDE_CAT_WHERE
protected static final java.lang.String EXCLUDE_CAT_WHERE
- See Also:
- Constant Field Values
-
EXCLUDE_NULL_PRODUCT_PROMOTIONS
protected static final java.lang.String EXCLUDE_NULL_PRODUCT_PROMOTIONS
- See Also:
- Constant Field Values
-
EXCLUDE_NULL_RESULTS_PROMOTIONS
protected static final java.lang.String EXCLUDE_NULL_RESULTS_PROMOTIONS
- See Also:
- Constant Field Values
-
FIND_PROMOTIONS_PROD_QUERY
protected static final java.lang.String FIND_PROMOTIONS_PROD_QUERY
- See Also:
- Constant Field Values
-
FIND_PROMOTIONS_CAT_QUERY
protected static final java.lang.String FIND_PROMOTIONS_CAT_QUERY
- See Also:
- Constant Field Values
-
FIND_PROMOTIONS_UNION1
protected static final java.lang.String FIND_PROMOTIONS_UNION1
- See Also:
- Constant Field Values
-
FIND_PROMOTIONS_UNION2
protected static final java.lang.String FIND_PROMOTIONS_UNION2
- See Also:
- Constant Field Values
-
FIND_PROMOTIONS_UNION3
protected static final java.lang.String FIND_PROMOTIONS_UNION3
- See Also:
- Constant Field Values
-
RULE_CODE_PARAM
protected static final java.lang.String RULE_CODE_PARAM
- See Also:
- Constant Field Values
-
-
Method Detail
-
findAllProductForPromotionSourceRule
public java.util.List<ProductForPromotionSourceRuleModel> findAllProductForPromotionSourceRule(PromotionSourceRuleModel rule, java.lang.String baseName)
Description copied from interface:PromotionSourceRuleDaoGet all ProductForPromotionSourceRuleModels for given promotion source rule and module name.- Specified by:
findAllProductForPromotionSourceRulein interfacePromotionSourceRuleDao- Parameters:
rule-PromotionSourceRuleModelto get products forbaseName- KIE base name- Returns:
- list of
ProductForPromotionSourceRuleModelfor given rule
-
findAllCatForPromotionSourceRule
public java.util.List<CatForPromotionSourceRuleModel> findAllCatForPromotionSourceRule(PromotionSourceRuleModel rule, java.lang.String baseName)
Description copied from interface:PromotionSourceRuleDaoGet all CatForPromotionSourceRuleModels for given promotion source rule and module name- Specified by:
findAllCatForPromotionSourceRulein interfacePromotionSourceRuleDao- Parameters:
rule-PromotionSourceRuleModelto get categories forbaseName- KIE base name- Returns:
- list of
CatForPromotionSourceRuleModelfor given rule
-
findAllExcludedCatForPromotionSourceRule
public java.util.List<ExcludedCatForRuleModel> findAllExcludedCatForPromotionSourceRule(PromotionSourceRuleModel rule, java.lang.String baseName)
Description copied from interface:PromotionSourceRuleDaoGet all ExcludedCatForRuleModels for given promotion source rule.- Specified by:
findAllExcludedCatForPromotionSourceRulein interfacePromotionSourceRuleDao- Parameters:
rule-PromotionSourceRuleModelto get excluded categories forbaseName- KIE base name- Returns:
- list of
ExcludedCatForRuleModelfor given rule
-
findAllCombinedCatsForRule
public java.util.List<CombinedCatsForRuleModel> findAllCombinedCatsForRule(PromotionSourceRuleModel rule, java.lang.String baseName)
Description copied from interface:PromotionSourceRuleDaoGet all CombinedCatsForRuleModels for given promotion source rule.- Specified by:
findAllCombinedCatsForRulein interfacePromotionSourceRuleDao- Parameters:
rule-PromotionSourceRuleModelto get excluded categories forbaseName- KIE base name- Returns:
- list of
CombinedCatsForRuleModelfor given rule
-
findAllExcludedProductForPromotionSourceRule
public java.util.List<ExcludedProductForRuleModel> findAllExcludedProductForPromotionSourceRule(PromotionSourceRuleModel rule, java.lang.String baseName)
Description copied from interface:PromotionSourceRuleDaoGet all ExcludedProductForRuleModel for given promotion source rule.- Specified by:
findAllExcludedProductForPromotionSourceRulein interfacePromotionSourceRuleDao- Parameters:
rule-PromotionSourceRuleModelto get excluded products forbaseName- KIE base name- Returns:
- list of
ExcludedProductForRuleModelfor given rule
-
findPromotions
public java.util.List<RuleBasedPromotionModel> findPromotions(java.util.Collection<PromotionGroupModel> promotionGroups, java.lang.String productCode, java.util.Set<java.lang.String> categoryCodes)
Description copied from interface:PromotionSourceRuleDaoFinds RuleBasedPromotionModels for given product code and category codes (but will exclude all rules for which the correspondingPromotionSourceRuleModel.getExcludeFromStorefrontDisplay()is set totrueOR current date is out ofAbstractRuleModel.getStartDate(),AbstractRuleModel.getEndDate()date range OR the rule statusAbstractRuleModel.getStatus()is not PUBLISHED).- Specified by:
findPromotionsin interfacePromotionSourceRuleDao- Parameters:
promotionGroups- collection of promotion groups to get promotion rules forproductCode- product code to get related source promotion rulescategoryCodes- category codes to get related source promotion rules- Returns:
- List of
RuleBasedPromotionModel
-
findLastConditionIdForRule
public java.lang.Integer findLastConditionIdForRule(PromotionSourceRuleModel rule)
Description copied from interface:PromotionSourceRuleDaoGet max conditionId in CombinedCatsForRule for one rule.- Specified by:
findLastConditionIdForRulein interfacePromotionSourceRuleDao- Parameters:
rule-PromotionSourceRuleModelto get max condition id for- Returns:
- Integer representing maximal condition id
-
findPromotions
protected java.util.List<RuleBasedPromotionModel> findPromotions(java.util.Collection<PromotionGroupModel> promotionGroups, java.lang.String productCode, java.util.Set<java.lang.String> categoryCodes, java.util.Date currentDate)
-
-