K
- the key typeE
- the element typepublic class ProductDAO<K,E> extends fr.paris.lutece.plugins.stock.commons.dao.AbstractStockDAO<Integer,Product> implements IProductDAO
Product
objects.Constructor and Description |
---|
ProductDAO() |
Modifier and Type | Method and Description |
---|---|
protected void |
buildCriteriaQuery(ProductFilter filter,
javax.persistence.criteria.Root<Product> root,
javax.persistence.criteria.CriteriaQuery<Product> query,
javax.persistence.criteria.CriteriaBuilder builder)
Build the criteria query from the filter.
|
protected List<javax.persistence.criteria.Predicate> |
buildPredicates(ProductFilter filter,
javax.persistence.criteria.Root<Product> root,
javax.persistence.criteria.CriteriaBuilder builder)
Build the predicate list from filter.
|
protected void |
buildSortQuery(ProductFilter filter,
javax.persistence.criteria.Root<Product> root,
javax.persistence.criteria.CriteriaQuery<Product> query,
javax.persistence.criteria.CriteriaBuilder builder)
Build the sort query.
|
List<Product> |
findByFilter(ProductFilter filter)
Find product list by filter.
|
fr.paris.lutece.plugins.stock.commons.ResultList<Product> |
findByFilter(ProductFilter filter,
fr.paris.lutece.plugins.stock.commons.dao.PaginationProperties paginationProperties)
Finds by filter.
|
List<Product> |
getAllByName(String name)
Returns products by name
|
Integer |
getCountProductALAfficheByDate(String strDate)
Return the number of current product
|
Integer |
getCountProductAVenirByDate(String strDate)
Return the number of future product
|
String |
getPluginName() |
Boolean |
isFull(Integer productId)
Check if product is ful
|
Boolean |
isType(Integer productId,
Integer genreId)
Check if product is type of representation
|
Boolean |
isTypeOffer(Integer productId,
Integer genreId,
String keyDate,
Timestamp now,
String annuleKey) |
addRestriction, createPagedQuery, findAll
createNativeQuery, getEntityManagerFactory
create, detach, findAll, findById, flush, getEM, getEntityClass, getEntityClassName, remove, update
public String getPluginName()
public List<Product> findByFilter(ProductFilter filter)
findByFilter
in interface IProductDAO
filter
- the filterpublic fr.paris.lutece.plugins.stock.commons.ResultList<Product> findByFilter(ProductFilter filter, fr.paris.lutece.plugins.stock.commons.dao.PaginationProperties paginationProperties)
findByFilter
in interface IProductDAO
filter
- the filterpaginationProperties
- the pagination propertiesprotected List<javax.persistence.criteria.Predicate> buildPredicates(ProductFilter filter, javax.persistence.criteria.Root<Product> root, javax.persistence.criteria.CriteriaBuilder builder)
filter
- the filterroot
- the product rootbuilder
- the criteria builderprotected void buildCriteriaQuery(ProductFilter filter, javax.persistence.criteria.Root<Product> root, javax.persistence.criteria.CriteriaQuery<Product> query, javax.persistence.criteria.CriteriaBuilder builder)
filter
- the filterroot
- the category rootquery
- the criteria querybuilder
- the criteria builderprotected void buildSortQuery(ProductFilter filter, javax.persistence.criteria.Root<Product> root, javax.persistence.criteria.CriteriaQuery<Product> query, javax.persistence.criteria.CriteriaBuilder builder)
filter
- the filterroot
- the product rootquery
- the criteria querybuilder
- the criteria builderpublic List<Product> getAllByName(String name)
getAllByName
in interface IProductDAO
name
- product namepublic Integer getCountProductALAfficheByDate(String strDate)
getCountProductALAfficheByDate
in interface IProductDAO
strDate
- the current datepublic Integer getCountProductAVenirByDate(String strDate)
getCountProductAVenirByDate
in interface IProductDAO
strDate
- the current datepublic Boolean isFull(Integer productId)
isFull
in interface IProductDAO
productId
- the product idpublic Boolean isType(Integer productId, Integer genreId)
isType
in interface IProductDAO
genreId
- the genre to checkpublic Boolean isTypeOffer(Integer productId, Integer genreId, String keyDate, Timestamp now, String annuleKey)
isTypeOffer
in interface IProductDAO
Copyright © 2020 City of Paris. All rights reserved.