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 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: AdvOfferCodeDao
      Saves 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:
      saveAllNonDuplicates in interface AdvOfferCodeDao
    • buildOfferCodeStringList

      protected List<String> buildOfferCodeStringList(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList)
    • findDuplicateCodes

      protected List<org.broadleafcommerce.core.offer.domain.OfferCode> findDuplicateCodes(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList)
    • 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

      protected void saveAllCodes(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList)
    • findOfferCodeGenerationById

      public OfferCodeGenerationInfo findOfferCodeGenerationById(Long ocgiId)
      Description copied from interface: AdvOfferCodeDao
      Returns the OfferCodeGenerationInfo by id.
      Specified by:
      findOfferCodeGenerationById in interface AdvOfferCodeDao
      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: AdvOfferCodeDao
      Updates the passed in info
      Specified by:
      updateInfo in interface AdvOfferCodeDao
    • createInfo

      @Transactional("blTransactionManager") public OfferCodeGenerationInfo createInfo()
      Specified by:
      createInfo in interface AdvOfferCodeDao
    • getJdbcBatchSize

      public int getJdbcBatchSize()
    • setJdbcBatchSize

      public void setJdbcBatchSize(int jdbcBatchSize)
    • clear

      public void clear()
      Specified by:
      clear in interface AdvOfferCodeDao
    • readBatchOfferCodeByCodeGenerationId

      public List<org.broadleafcommerce.core.offer.domain.OfferCode> readBatchOfferCodeByCodeGenerationId(Long firstId, int count, Long ocgiId)
      Specified by:
      readBatchOfferCodeByCodeGenerationId in interface AdvOfferCodeDao
    • readBatchOfferCodeByCodeGenerationId

      public List<org.broadleafcommerce.core.offer.domain.OfferCode> readBatchOfferCodeByCodeGenerationId(int firstRecord, int count, Long ocgiId)
      Specified by:
      readBatchOfferCodeByCodeGenerationId in interface AdvOfferCodeDao
    • readNumberOfOfferCodesForCodeGroup

      public Long readNumberOfOfferCodesForCodeGroup(Long codeGroupId)
      Specified by:
      readNumberOfOfferCodesForCodeGroup in interface AdvOfferCodeDao