org.broadleafcommerce.core.offer.dao
Class OfferDaoImpl

java.lang.Object
  extended by org.broadleafcommerce.core.offer.dao.OfferDaoImpl
All Implemented Interfaces:
OfferDao

@Repository(value="blOfferDao")
public class OfferDaoImpl
extends Object
implements OfferDao


Field Summary
protected  Date currentDate
           
protected  Long currentDateResolution
           
protected  javax.persistence.EntityManager em
           
protected  EntityConfiguration entityConfiguration
           
 
Constructor Summary
OfferDaoImpl()
           
 
Method Summary
 Offer create()
           
 CandidateFulfillmentGroupOffer createCandidateFulfillmentGroupOffer()
           
 CandidateItemOffer createCandidateItemOffer()
           
 CandidateOrderOffer createCandidateOrderOffer()
           
 FulfillmentGroupAdjustment createFulfillmentGroupAdjustment()
           
 OfferInfo createOfferInfo()
           
 OrderAdjustment createOrderAdjustment()
           
 OrderItemAdjustment createOrderItemAdjustment()
           
 OrderItemPriceDetailAdjustment createOrderItemPriceDetailAdjustment()
           
 void delete(Offer offer)
           
 void delete(OfferInfo offerInfo)
           
 Long getCurrentDateResolution()
          Returns the number of milliseconds that the current date/time will be cached for queries before refreshing.
protected  Date getDateFactoringInDateResolution(Date currentDate)
           
 List<Offer> readAllOffers()
           
 Offer readOfferById(Long offerId)
           
 List<Offer> readOffersByAutomaticDeliveryType()
           
 Offer save(Offer offer)
           
 OfferInfo save(OfferInfo offerInfo)
           
 void setCurrentDateResolution(Long currentDateResolution)
          Sets the number of milliseconds that the current date/time will be cached for queries before refreshing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

em

protected javax.persistence.EntityManager em

entityConfiguration

protected EntityConfiguration entityConfiguration

currentDateResolution

protected Long currentDateResolution

currentDate

protected Date currentDate
Constructor Detail

OfferDaoImpl

public OfferDaoImpl()
Method Detail

getDateFactoringInDateResolution

protected Date getDateFactoringInDateResolution(Date currentDate)

create

public Offer create()
Specified by:
create in interface OfferDao

createOfferInfo

public OfferInfo createOfferInfo()
Specified by:
createOfferInfo in interface OfferDao

createCandidateOrderOffer

public CandidateOrderOffer createCandidateOrderOffer()
Specified by:
createCandidateOrderOffer in interface OfferDao

createCandidateItemOffer

public CandidateItemOffer createCandidateItemOffer()
Specified by:
createCandidateItemOffer in interface OfferDao

createCandidateFulfillmentGroupOffer

public CandidateFulfillmentGroupOffer createCandidateFulfillmentGroupOffer()
Specified by:
createCandidateFulfillmentGroupOffer in interface OfferDao

createOrderItemAdjustment

public OrderItemAdjustment createOrderItemAdjustment()
Specified by:
createOrderItemAdjustment in interface OfferDao

createOrderItemPriceDetailAdjustment

public OrderItemPriceDetailAdjustment createOrderItemPriceDetailAdjustment()
Specified by:
createOrderItemPriceDetailAdjustment in interface OfferDao

createOrderAdjustment

public OrderAdjustment createOrderAdjustment()
Specified by:
createOrderAdjustment in interface OfferDao

createFulfillmentGroupAdjustment

public FulfillmentGroupAdjustment createFulfillmentGroupAdjustment()
Specified by:
createFulfillmentGroupAdjustment in interface OfferDao

delete

public void delete(Offer offer)
Specified by:
delete in interface OfferDao

delete

public void delete(OfferInfo offerInfo)
Specified by:
delete in interface OfferDao

save

public Offer save(Offer offer)
Specified by:
save in interface OfferDao

save

public OfferInfo save(OfferInfo offerInfo)
Specified by:
save in interface OfferDao

readAllOffers

public List<Offer> readAllOffers()
Specified by:
readAllOffers in interface OfferDao

readOfferById

public Offer readOfferById(Long offerId)
Specified by:
readOfferById in interface OfferDao

readOffersByAutomaticDeliveryType

public List<Offer> readOffersByAutomaticDeliveryType()
Specified by:
readOffersByAutomaticDeliveryType in interface OfferDao

getCurrentDateResolution

public Long getCurrentDateResolution()
Description copied from interface: OfferDao
Returns the number of milliseconds that the current date/time will be cached for queries before refreshing. This aids in query caching, otherwise every query that utilized current date would be different and caching would be ineffective.

Specified by:
getCurrentDateResolution in interface OfferDao
Returns:
the milliseconds to cache the current date/time

setCurrentDateResolution

public void setCurrentDateResolution(Long currentDateResolution)
Description copied from interface: OfferDao
Sets the number of milliseconds that the current date/time will be cached for queries before refreshing. This aids in query caching, otherwise every query that utilized current date would be different and caching would be ineffective.

Specified by:
setCurrentDateResolution in interface OfferDao
Parameters:
currentDateResolution - the milliseconds to cache the current date/time


Copyright © 2013. All Rights Reserved.