|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.broadleafcommerce.core.catalog.dao.ProductDaoImpl
@Repository(value="blProductDao") public class ProductDaoImpl
| Field Summary | |
|---|---|
protected Date |
cachedDate
|
protected Long |
currentDateResolution
|
protected javax.persistence.EntityManager |
em
|
protected EntityConfiguration |
entityConfiguration
|
| Constructor Summary | |
|---|---|
ProductDaoImpl()
|
|
| Method Summary | |
|---|---|
protected void |
attachActiveRestriction(Date currentDate,
javax.persistence.criteria.Path<? extends Product> product,
javax.persistence.criteria.Path<? extends Sku> sku,
List<javax.persistence.criteria.Predicate> restrictions)
|
protected void |
attachOrderBy(ProductSearchCriteria searchCriteria,
javax.persistence.criteria.From<?,? extends Product> product,
javax.persistence.criteria.Path<? extends Sku> sku,
javax.persistence.criteria.CriteriaQuery<?> criteria)
|
protected void |
attachProductSearchCriteria(ProductSearchCriteria searchCriteria,
javax.persistence.criteria.From<?,? extends Product> product,
javax.persistence.criteria.From<?,? extends Sku> sku,
List<javax.persistence.criteria.Predicate> restrictions)
|
Product |
create(ProductType productType)
Create a new Product instance. |
void |
delete(Product product)
Remove the passed in product instance from the datastore |
List<Product> |
findProductByURI(String uri)
Look up a product that matches the given URI |
protected javax.persistence.criteria.CriteriaQuery<Product> |
getCriteriaForActiveProducts(Date currentDate)
|
protected Date |
getCurrentDateAfterFactoringInDateResolution()
|
Long |
getCurrentDateResolution()
Returns the number of milliseconds that the current date/time will be cached for queries before refreshing. |
List<Product> |
readActiveProductsByCategory(Long categoryId)
Find all products whose in the passed in category. |
List<Product> |
readActiveProductsByCategory(Long categoryId,
Date currentDate)
Deprecated. |
List<Product> |
readActiveProductsByCategory(Long categoryId,
Date currentDate,
int limit,
int offset)
Deprecated. |
List<Product> |
readActiveProductsByCategory(Long categoryId,
int limit,
int offset)
Read a page of products for a category. |
protected List<Product> |
readActiveProductsByCategoryInternal(Long categoryId,
Date currentDate)
|
List<Product> |
readActiveProductsByCategoryInternal(Long categoryId,
Date currentDate,
int limit,
int offset)
|
List<Product> |
readAllActiveProducts()
Reads all products from the database that are currently active. |
List<Product> |
readAllActiveProducts(Date currentDate)
Deprecated. |
List<Product> |
readAllActiveProducts(int page,
int pageSize)
Reads all products from the database that are currently active. |
List<Product> |
readAllActiveProducts(int page,
int pageSize,
Date currentDate)
Deprecated. |
protected List<Product> |
readAllActiveProductsInternal(Date currentDate)
|
protected List<Product> |
readAllActiveProductsInternal(int page,
int pageSize,
Date currentDate)
|
List<ProductBundle> |
readAutomaticProductBundles()
Returns all active ProductBundles whose automatic property is true. |
Long |
readCountAllActiveProducts()
Returns the number of products that are currently active. |
Long |
readCountAllActiveProducts(Date currentDate)
Deprecated. |
protected Long |
readCountAllActiveProductsInternal(Date currentDate)
|
List<Product> |
readFilteredActiveProductsByCategory(Long categoryId,
Date currentDate,
ProductSearchCriteria searchCriteria)
Deprecated. |
List<Product> |
readFilteredActiveProductsByCategory(Long categoryId,
ProductSearchCriteria searchCriteria)
Find all active products that are related to the given category, match the given search criteria, and are not marked as archived. |
protected List<Product> |
readFilteredActiveProductsByCategoryInternal(Long categoryId,
Date currentDate,
ProductSearchCriteria searchCriteria)
|
List<Product> |
readFilteredActiveProductsByQuery(String query,
Date currentDate,
ProductSearchCriteria searchCriteria)
Deprecated. |
List<Product> |
readFilteredActiveProductsByQuery(String query,
ProductSearchCriteria searchCriteria)
Find all products whose start and end dates are before and after the passed in date, who match the search string, match the given search criteria, and are not marked as archived. |
protected List<Product> |
readFilteredActiveProductsByQueryInternal(String query,
Date currentDate,
ProductSearchCriteria searchCriteria)
|
Product |
readProductById(Long productId)
Retrieve a Product instance by its primary key |
List<Product> |
readProductsByCategory(Long categoryId)
Find all products related to the passed in category |
List<Product> |
readProductsByCategory(Long categoryId,
int limit,
int offset)
Find all products related to the passed in category |
List<Product> |
readProductsByIds(List<Long> productIds)
Retrieves a list of Product instances by their primary keys |
List<Product> |
readProductsByName(String searchName)
Find all Product instances whose name starts with
or is equal to the passed in search parameter |
List<Product> |
readProductsByName(String searchName,
int limit,
int offset)
Find a subset of Product instances whose name starts with
or is equal to the passed in search parameter. |
Product |
save(Product product)
Persist a Product instance to the datastore |
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 |
|---|
protected javax.persistence.EntityManager em
protected EntityConfiguration entityConfiguration
protected Long currentDateResolution
protected Date cachedDate
| Constructor Detail |
|---|
public ProductDaoImpl()
| Method Detail |
|---|
public Product save(Product product)
ProductDaoProduct instance to the datastore
save in interface ProductDaoproduct - the product instance
public Product readProductById(Long productId)
ProductDaoProduct instance by its primary key
readProductById in interface ProductDaoproductId - the primary key of the product
public List<Product> readProductsByIds(List<Long> productIds)
ProductDao
readProductsByIds in interface ProductDaoproductIds - the list of primary keys for products
public List<Product> readProductsByName(String searchName)
ProductDaoProduct instances whose name starts with
or is equal to the passed in search parameter
readProductsByName in interface ProductDaosearchName - the partial or whole name to match
public List<Product> readProductsByName(@Nonnull
String searchName,
@Nonnull
int limit,
@Nonnull
int offset)
ProductDaoProduct instances whose name starts with
or is equal to the passed in search parameter. Res
readProductsByName in interface ProductDaolimit - the maximum number of resultsoffset - the starting point in the record set
protected Date getCurrentDateAfterFactoringInDateResolution()
public List<Product> readActiveProductsByCategory(Long categoryId)
ProductDao
readActiveProductsByCategory in interface ProductDaocategoryId - the primary key of the category to whom the resulting product list should be related
@Deprecated
public List<Product> readActiveProductsByCategory(Long categoryId,
Date currentDate)
readActiveProductsByCategory in interface ProductDaocategoryId - the primary key of the category to whom the resulting product list should be relatedcurrentDate - the date for which the products should be checked against to determine their active state
protected List<Product> readActiveProductsByCategoryInternal(Long categoryId,
Date currentDate)
public List<Product> readFilteredActiveProductsByQuery(String query,
ProductSearchCriteria searchCriteria)
ProductDao
readFilteredActiveProductsByQuery in interface ProductDao
@Deprecated
public List<Product> readFilteredActiveProductsByQuery(String query,
Date currentDate,
ProductSearchCriteria searchCriteria)
readFilteredActiveProductsByQuery in interface ProductDao
protected List<Product> readFilteredActiveProductsByQueryInternal(String query,
Date currentDate,
ProductSearchCriteria searchCriteria)
public List<Product> readFilteredActiveProductsByCategory(Long categoryId,
ProductSearchCriteria searchCriteria)
ProductDao
readFilteredActiveProductsByCategory in interface ProductDao
@Deprecated
public List<Product> readFilteredActiveProductsByCategory(Long categoryId,
Date currentDate,
ProductSearchCriteria searchCriteria)
readFilteredActiveProductsByCategory in interface ProductDao
protected List<Product> readFilteredActiveProductsByCategoryInternal(Long categoryId,
Date currentDate,
ProductSearchCriteria searchCriteria)
protected void attachActiveRestriction(Date currentDate,
javax.persistence.criteria.Path<? extends Product> product,
javax.persistence.criteria.Path<? extends Sku> sku,
List<javax.persistence.criteria.Predicate> restrictions)
protected void attachOrderBy(ProductSearchCriteria searchCriteria,
javax.persistence.criteria.From<?,? extends Product> product,
javax.persistence.criteria.Path<? extends Sku> sku,
javax.persistence.criteria.CriteriaQuery<?> criteria)
protected void attachProductSearchCriteria(ProductSearchCriteria searchCriteria,
javax.persistence.criteria.From<?,? extends Product> product,
javax.persistence.criteria.From<?,? extends Sku> sku,
List<javax.persistence.criteria.Predicate> restrictions)
public List<Product> readActiveProductsByCategory(Long categoryId,
int limit,
int offset)
ProductDao
readActiveProductsByCategory in interface ProductDao
@Deprecated
public List<Product> readActiveProductsByCategory(Long categoryId,
Date currentDate,
int limit,
int offset)
readActiveProductsByCategory in interface ProductDao
public List<Product> readActiveProductsByCategoryInternal(Long categoryId,
Date currentDate,
int limit,
int offset)
public List<Product> readProductsByCategory(Long categoryId)
ProductDao
readProductsByCategory in interface ProductDaocategoryId - the primary key of the category to whom the resulting product list should be related
public List<Product> readProductsByCategory(Long categoryId,
int limit,
int offset)
ProductDao
readProductsByCategory in interface ProductDaocategoryId - the primary key of the category to whom the resulting product list should be relatedlimit - the maximum number of results to returnoffset - the starting point in the record set
public void delete(Product product)
ProductDao
delete in interface ProductDaoproduct - the product instance to removepublic Product create(ProductType productType)
ProductDaoProduct 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 Product to instantiate. To make Broadleaf instantiate your
extension of Product 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>
create in interface ProductDaoproductType - the type of product you would like to create (presumably a Product or ProductSku instance). The getType method of ProductType provides the key for the entity configuration.
Product instance based on the Broadleaf entity configuration.public List<ProductBundle> readAutomaticProductBundles()
ProductDao
readAutomaticProductBundles in interface ProductDaopublic Long getCurrentDateResolution()
ProductDao
getCurrentDateResolution in interface ProductDaopublic void setCurrentDateResolution(Long currentDateResolution)
ProductDao
setCurrentDateResolution in interface ProductDaocurrentDateResolution - the milliseconds to cache the current date/timepublic List<Product> findProductByURI(String uri)
ProductDao
findProductByURI in interface ProductDao
public List<Product> readAllActiveProducts(int page,
int pageSize)
ProductDaoProductDao.readAllActiveProducts() in that this one will utilize database paging.
It will fetch results in pages. For example, if page = 3 and pageSize = 25, this method would
return rows 75-99 from the database.
readAllActiveProducts in interface ProductDaopage - - the number of the page to get (0 indexed)pageSize - - the number of results per page
@Deprecated
public List<Product> readAllActiveProducts(int page,
int pageSize,
Date currentDate)
readAllActiveProducts in interface ProductDaopage - - the number of the page to get (0 indexed)pageSize - - the number of results per page
protected List<Product> readAllActiveProductsInternal(int page,
int pageSize,
Date currentDate)
public List<Product> readAllActiveProducts()
ProductDao
readAllActiveProducts in interface ProductDao@Deprecated public List<Product> readAllActiveProducts(Date currentDate)
readAllActiveProducts in interface ProductDaoprotected List<Product> readAllActiveProductsInternal(Date currentDate)
public Long readCountAllActiveProducts()
ProductDao
readCountAllActiveProducts in interface ProductDao@Deprecated public Long readCountAllActiveProducts(Date currentDate)
readCountAllActiveProducts in interface ProductDaoprotected Long readCountAllActiveProductsInternal(Date currentDate)
protected javax.persistence.criteria.CriteriaQuery<Product> getCriteriaForActiveProducts(Date currentDate)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||