@Repository(value="blAdvOfferCodeDao") public class AdvOfferCodeDaoImpl extends Object implements AdvOfferCodeDao
| Modifier and Type | Field and Description |
|---|---|
protected javax.persistence.EntityManager |
em |
protected org.broadleafcommerce.common.persistence.EntityConfiguration |
entityConfiguration |
protected org.broadleafcommerce.core.offer.dao.OfferDao |
offerDao |
| Constructor and Description |
|---|
AdvOfferCodeDaoImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected List<String> |
buildOfferCodeStringList(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList) |
void |
clear() |
OfferCodeGenerationInfo |
createInfo() |
protected List<org.broadleafcommerce.core.offer.domain.OfferCode> |
findDuplicateCodes(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList) |
OfferCodeGenerationInfo |
findOfferCodeGenerationById(Long ocgiId)
Returns the
OfferCodeGenerationInfo by id. |
int |
getJdbcBatchSize() |
protected void |
persistListWithBatchSize(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList,
int batchSize) |
List<org.broadleafcommerce.core.offer.domain.OfferCode> |
readBatchOfferCodeByCodeGenerationId(Long firstId,
int count,
Long ocgiId) |
Long |
readNumberOfOfferCodesForCodeGroup(Long codeGroupId) |
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.
|
protected void |
saveAllCodes(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList) |
void |
saveAllNonDuplicates(OfferCodeGenerationInfo info,
List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList)
Saves the list of offer codes and makes them active.
|
void |
setJdbcBatchSize(int jdbcBatchSize) |
OfferCodeGenerationInfo |
updateInfo(OfferCodeGenerationInfo info)
Updates the passed in info
|
protected javax.persistence.EntityManager em
protected org.broadleafcommerce.common.persistence.EntityConfiguration entityConfiguration
protected org.broadleafcommerce.core.offer.dao.OfferDao offerDao
public void saveAllNonDuplicates(OfferCodeGenerationInfo info, List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList)
AdvOfferCodeDaosaveAllNonDuplicates in interface AdvOfferCodeDaoprotected List<String> buildOfferCodeStringList(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList)
protected List<org.broadleafcommerce.core.offer.domain.OfferCode> findDuplicateCodes(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList)
protected void removeDuplicatesFromList(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList, List<org.broadleafcommerce.core.offer.domain.OfferCode> duplicateOfferCodes)
offerCodeList - duplicateOfferCodes - protected void saveAllCodes(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList)
public OfferCodeGenerationInfo findOfferCodeGenerationById(Long ocgiId)
AdvOfferCodeDaoOfferCodeGenerationInfo by id.findOfferCodeGenerationById in interface AdvOfferCodeDaoprotected void persistListWithBatchSize(List<org.broadleafcommerce.core.offer.domain.OfferCode> offerCodeList, int batchSize)
@Transactional(value="blTransactionManager") public OfferCodeGenerationInfo updateInfo(OfferCodeGenerationInfo info)
AdvOfferCodeDaoupdateInfo in interface AdvOfferCodeDao@Transactional(value="blTransactionManager") public OfferCodeGenerationInfo createInfo()
createInfo in interface AdvOfferCodeDaopublic int getJdbcBatchSize()
public void setJdbcBatchSize(int jdbcBatchSize)
public void clear()
clear in interface AdvOfferCodeDaopublic List<org.broadleafcommerce.core.offer.domain.OfferCode> readBatchOfferCodeByCodeGenerationId(Long firstId, int count, Long ocgiId)
readBatchOfferCodeByCodeGenerationId in interface AdvOfferCodeDaopublic Long readNumberOfOfferCodesForCodeGroup(Long codeGroupId)
readNumberOfOfferCodesForCodeGroup in interface AdvOfferCodeDaoCopyright © 2020. All rights reserved.