K
- the key typeE
- the entity typepublic class PurchaseDAO<K,E> extends fr.paris.lutece.plugins.stock.commons.dao.AbstractStockDAO<Integer,Purchase> implements IPurchaseDAO
Purchase
objects.Constructor and Description |
---|
PurchaseDAO() |
Modifier and Type | Method and Description |
---|---|
protected void |
buildCriteriaQuery(PurchaseFilter filter,
javax.persistence.criteria.Root<Purchase> root,
javax.persistence.criteria.CriteriaQuery<Purchase> query,
javax.persistence.criteria.CriteriaBuilder builder)
Build the criteria query used when purchases are searched by filter.
|
protected void |
buildSortQuery(PurchaseFilter filter,
javax.persistence.criteria.Root<Purchase> root,
javax.persistence.criteria.CriteriaQuery<Purchase> query,
javax.persistence.criteria.CriteriaBuilder builder)
Add the order by parameter to the query.
|
fr.paris.lutece.plugins.stock.commons.ResultList<Purchase> |
findByFilter(PurchaseFilter filter,
fr.paris.lutece.plugins.stock.commons.dao.PaginationProperties paginationProperties)
Find purchases by filter.
|
Integer |
getCountPurchaseByBeginDateAndLastDate(String strDateDebut,
String strDateFin)
Return the number of purchase for the current month
|
String |
getPluginName() |
Integer |
getQuantityPurchasedByIdProductAndUserName(Integer idProduct,
Integer idOfferGenre,
String userName)
Return the number of reservation for an offer and an agent.
|
addRestriction, createPagedQuery, findAll
createNativeQuery, getEntityManagerFactory
create, detach, findAll, findById, flush, getEM, getEntityClass, getEntityClassName, remove, update
public String getPluginName()
public fr.paris.lutece.plugins.stock.commons.ResultList<Purchase> findByFilter(PurchaseFilter filter, fr.paris.lutece.plugins.stock.commons.dao.PaginationProperties paginationProperties)
findByFilter
in interface IPurchaseDAO
filter
- the filterpaginationProperties
- the pagination propertiesprotected void buildCriteriaQuery(PurchaseFilter filter, javax.persistence.criteria.Root<Purchase> root, javax.persistence.criteria.CriteriaQuery<Purchase> query, javax.persistence.criteria.CriteriaBuilder builder)
filter
- the filterroot
- the purchase rootquery
- the criteria querybuilder
- the criteria builderprotected void buildSortQuery(PurchaseFilter filter, javax.persistence.criteria.Root<Purchase> root, javax.persistence.criteria.CriteriaQuery<Purchase> query, javax.persistence.criteria.CriteriaBuilder builder)
filter
- the filterroot
- the purchase rootquery
- the criteria querybuilder
- the criteria builderpublic Integer getQuantityPurchasedByIdProductAndUserName(Integer idProduct, Integer idOfferGenre, String userName)
getQuantityPurchasedByIdProductAndUserName
in interface IPurchaseDAO
idProduct
- offer ididOfferGenre
- the id offer genreuserName
- agent userNamepublic Integer getCountPurchaseByBeginDateAndLastDate(String strDateDebut, String strDateFin)
getCountPurchaseByBeginDateAndLastDate
in interface IPurchaseDAO
strDateDebut
- the first date of the monthstrDateFin
- the last date of the monthCopyright © 2020 City of Paris. All rights reserved.