| Modifier and Type | Field and Description |
|---|---|
protected Date |
cachedDate |
protected Long |
currentDateResolution |
protected javax.persistence.EntityManager |
em |
protected EntityConfiguration |
entityConfiguration |
protected SkuDaoExtensionManager |
extensionManager |
protected SandBoxHelper |
sandBoxHelper |
| Constructor and Description |
|---|
SkuDaoImpl() |
| Modifier and Type | Method and Description |
|---|---|
Sku |
create()
Create a new
Sku instance. |
void |
delete(Sku sku)
Remove the
Sku instance from the datastore |
List<Sku> |
findSkuByURI(String uri)
Look up a sku that matches the given URI
|
protected javax.persistence.criteria.CriteriaQuery<Sku> |
getCriteriaForActiveSkus(Date currentDate) |
protected javax.persistence.criteria.CriteriaQuery<Sku> |
getCriteriaForActiveSkus(Date currentDate,
Long lastId) |
Long |
getCurrentDateResolution()
Returns the number of milliseconds that the current date/time will be cached for queries before refreshing.
|
List<Sku> |
readAllActiveSkus(Integer pageSize,
Long lastId)
Reads all skus from the database that are currently active.
|
List<Sku> |
readAllActiveSkus(int page,
int pageSize)
Reads all Skus from the database that are currently active.
|
protected List<Sku> |
readAllActiveSkusInternal(Integer pageSize,
Date currentDate,
Long lastId) |
protected List<Sku> |
readAllActiveSkusInternal(int page,
int pageSize,
Date currentDate) |
List<Sku> |
readAllSkus()
Retrieve all
Sku instances from the datastore |
List<Sku> |
readAllSkus(int offset,
int limit)
Retrieve all
Sku instances from the datastore |
Long |
readCountAllActiveSkus()
Returns the number of Skus that are currently active.
|
protected Long |
readCountAllActiveSkusInternal(Date currentDate) |
Sku |
readFirstSku()
Retrieve the
Sku instance whose primary key is the smallest
of all skus in the datastore |
Sku |
readSkuByExternalId(String externalId)
Retrieve a
Sku instance by its external id |
Sku |
readSkuById(Long skuId)
Retrieve a
Sku instance by its primary key |
Sku |
readSkuByUpc(String upc)
Queries for a
Sku instance by its Universal Product Code (UPC). |
List<Sku> |
readSkusByIds(List<Long> skuIds)
Find all the
Sku instances whose primary key matches
one of the values from the passed in list |
Sku |
save(Sku sku)
Persist a
Sku instance to the datastore |
SkuFee |
saveSkuFee(SkuFee fee) |
void |
setCurrentDateResolution(Long currentDateResolution)
Sets the number of milliseconds that the current date/time will be cached for queries before refreshing.
|
protected javax.persistence.EntityManager em
protected EntityConfiguration entityConfiguration
protected SandBoxHelper sandBoxHelper
protected SkuDaoExtensionManager extensionManager
@Value(value="${query.dateResolution.sku:10000}")
protected Long currentDateResolution
protected Date cachedDate
public Sku save(Sku sku)
SkuDaoSku instance to the datastorepublic SkuFee saveSkuFee(SkuFee fee)
saveSkuFee in interface SkuDaopublic Sku readSkuById(Long skuId)
SkuDaoSku instance by its primary keyreadSkuById in interface SkuDaoskuId - the primary key of the skupublic Sku readSkuByExternalId(String externalId)
SkuDaoSku instance by its external idreadSkuByExternalId in interface SkuDaoexternalId - the external id of the skupublic Sku readSkuByUpc(String upc)
SkuDaoSku instance by its Universal Product Code (UPC).readSkuByUpc in interface SkuDaopublic Sku readFirstSku()
SkuDaoSku instance whose primary key is the smallest
of all skus in the datastorereadFirstSku in interface SkuDaopublic List<Sku> readAllSkus()
SkuDaoSku instances from the datastorereadAllSkus in interface SkuDaopublic List<Sku> readAllSkus(int offset, int limit)
SkuDaoSku instances from the datastorereadAllSkus in interface SkuDaooffset - the starting offset of the querylimit - the maximum number of Skus to gatherpublic List<Sku> readSkusByIds(List<Long> skuIds)
SkuDaoSku instances whose primary key matches
one of the values from the passed in listreadSkusByIds in interface SkuDaoskuIds - the list of primary key valuespublic void delete(Sku sku)
SkuDaoSku instance from the datastorepublic Sku create()
SkuDaoSku instance. The system will use the configuration in
/BroadleafCommerce/core/BroadleafCommerceFramework/src/main/resources/bl-framework-applicationContext-entity.xml
to determine which polymorphic version of Sku to instantiate. To make Broadleaf instantiate your
extension of Sku by default, include an entity configuration bean in your application context xml similar to:
<bean id="blEntityConfiguration" class="org.broadleafcommerce.common.persistence.EntityConfiguration">
<property name="entityContexts">
<list>
<value>classpath:myCompany-applicationContext-entity.xml</value>
</list>
</property>
</bean>
public Long readCountAllActiveSkus()
SkuDaoreadCountAllActiveSkus in interface SkuDaopublic List<Sku> readAllActiveSkus(int page, int pageSize)
SkuDaoreadAllActiveSkus in interface SkuDaopage - - the number of the page to get (0 indexed)pageSize - - the number of results per pagepublic List<Sku> readAllActiveSkus(Integer pageSize, Long lastId)
SkuDaoSkuDao.readAllActiveSkus(int, int),
but rather limits the retrieved records to those greater than the given id and returns a max results of pageSize. This
is more efficient that using an offset, since the database will not have to retrieve all the records from the beginning
of the table and trim the offset.readAllActiveSkus in interface SkuDaopageSize - the number of results per pagelastId - the last id from the previous page - can be null if this is the first page requestpublic Long getCurrentDateResolution()
SkuDaogetCurrentDateResolution in interface SkuDaopublic void setCurrentDateResolution(Long currentDateResolution)
SkuDaosetCurrentDateResolution in interface SkuDaocurrentDateResolution - the milliseconds to cache the current date/timepublic List<Sku> findSkuByURI(String uri)
SkuDaofindSkuByURI in interface SkuDaouri - - the relative URL to look up the sku byprotected List<Sku> readAllActiveSkusInternal(int page, int pageSize, Date currentDate)
protected List<Sku> readAllActiveSkusInternal(Integer pageSize, Date currentDate, Long lastId)
protected javax.persistence.criteria.CriteriaQuery<Sku> getCriteriaForActiveSkus(Date currentDate)
Copyright © 2024. All rights reserved.