Class AdvOfferCodeDaoImpl
java.lang.Object
com.broadleafcommerce.advancedoffer.codes.dao.AdvOfferCodeDaoImpl
- All Implemented Interfaces:
AdvOfferCodeDao
@Repository("blAdvOfferCodeDao")
public class AdvOfferCodeDaoImpl
extends Object
implements AdvOfferCodeDao
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected jakarta.persistence.EntityManagerprotected org.broadleafcommerce.common.persistence.EntityConfigurationprotected org.broadleafcommerce.core.offer.dao.OfferDao -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildOfferCodeStringList(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList) voidclear()protected List<org.broadleafcommerce.core.offer.domain.OfferCode>findDuplicateCodes(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList) findOfferCodeGenerationById(Long ocgiId) Returns theOfferCodeGenerationInfoby id.intprotected voidpersistListWithBatchSize(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList, int batchSize) List<org.broadleafcommerce.core.offer.domain.OfferCode>readBatchOfferCodeByCodeGenerationId(int firstRecord, int count, Long ocgiId) List<org.broadleafcommerce.core.offer.domain.OfferCode>readBatchOfferCodeByCodeGenerationId(Long firstId, int count, Long ocgiId) readNumberOfOfferCodesForCodeGroup(Long codeGroupId) protected voidremoveDuplicatesFromList(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList, List<org.broadleafcommerce.core.offer.domain.OfferCode> duplicateOfferCodes) Iterate through the codes we are about to save.protected voidsaveAllCodes(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList) voidsaveAllNonDuplicates(OfferCodeGenerationInfo info, List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList) Saves the list of offer codes and makes them active.voidsetJdbcBatchSize(int jdbcBatchSize) Updates the passed in info
-
Field Details
-
em
protected jakarta.persistence.EntityManager em -
entityConfiguration
protected org.broadleafcommerce.common.persistence.EntityConfiguration entityConfiguration -
offerDao
protected org.broadleafcommerce.core.offer.dao.OfferDao offerDao
-
-
Constructor Details
-
AdvOfferCodeDaoImpl
public AdvOfferCodeDaoImpl()
-
-
Method Details
-
saveAllNonDuplicates
public void saveAllNonDuplicates(OfferCodeGenerationInfo info, List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList) Description copied from interface:AdvOfferCodeDaoSaves the list of offer codes and makes them active. If any of the offer codes are already active in the system, they will be deleted.Duplicates will be removed from the passed in list.
- Specified by:
saveAllNonDuplicatesin interfaceAdvOfferCodeDao
-
buildOfferCodeStringList
-
findDuplicateCodes
-
removeDuplicatesFromList
protected void removeDuplicatesFromList(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList, List<org.broadleafcommerce.core.offer.domain.OfferCode> duplicateOfferCodes) Iterate through the codes we are about to save. If the code is in the duplicateOfferCodes list then remove it.- Parameters:
offerCodeList-duplicateOfferCodes-
-
saveAllCodes
-
findOfferCodeGenerationById
Description copied from interface:AdvOfferCodeDaoReturns theOfferCodeGenerationInfoby id.- Specified by:
findOfferCodeGenerationByIdin interfaceAdvOfferCodeDao- Returns:
-
persistListWithBatchSize
protected void persistListWithBatchSize(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList, int batchSize) -
updateInfo
@Transactional("blTransactionManager") public OfferCodeGenerationInfo updateInfo(OfferCodeGenerationInfo info) Description copied from interface:AdvOfferCodeDaoUpdates the passed in info- Specified by:
updateInfoin interfaceAdvOfferCodeDao
-
createInfo
- Specified by:
createInfoin interfaceAdvOfferCodeDao
-
getJdbcBatchSize
public int getJdbcBatchSize() -
setJdbcBatchSize
public void setJdbcBatchSize(int jdbcBatchSize) -
clear
public void clear()- Specified by:
clearin interfaceAdvOfferCodeDao
-
readBatchOfferCodeByCodeGenerationId
public List<org.broadleafcommerce.core.offer.domain.OfferCode> readBatchOfferCodeByCodeGenerationId(Long firstId, int count, Long ocgiId) - Specified by:
readBatchOfferCodeByCodeGenerationIdin interfaceAdvOfferCodeDao
-
readBatchOfferCodeByCodeGenerationId
public List<org.broadleafcommerce.core.offer.domain.OfferCode> readBatchOfferCodeByCodeGenerationId(int firstRecord, int count, Long ocgiId) - Specified by:
readBatchOfferCodeByCodeGenerationIdin interfaceAdvOfferCodeDao
-
readNumberOfOfferCodesForCodeGroup
- Specified by:
readNumberOfOfferCodesForCodeGroupin interfaceAdvOfferCodeDao
-