fr.paris.lutece.plugins.stock.business.product
Class ProductDAO<K,E>

java.lang.Object
  extended by fr.paris.lutece.util.jpa.JPAGenericDAO<K,E>
      extended by fr.paris.lutece.portal.service.jpa.JPALuteceDAO<K,E>
          extended by fr.paris.lutece.plugins.stock.commons.dao.AbstractStockDAO<java.lang.Integer,Product>
              extended by fr.paris.lutece.plugins.stock.business.product.ProductDAO<K,E>
Type Parameters:
K - the key type
E - the element type
All Implemented Interfaces:
IProductDAO, fr.paris.lutece.plugins.stock.commons.dao.IStockDAO<java.lang.Integer,Product>, fr.paris.lutece.util.jpa.IGenericDAO<java.lang.Integer,Product>

public class ProductDAO<K,E>
extends fr.paris.lutece.plugins.stock.commons.dao.AbstractStockDAO<java.lang.Integer,Product>
implements IProductDAO

This class provides Data Access methods for Product objects.


Constructor Summary
ProductDAO()
           
 
Method Summary
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  java.util.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.
 java.util.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.
 java.util.List<Product> getAllByName(java.lang.String name)
          Returns products by name
 java.lang.Integer getCountProductALAfficheByDate(java.lang.String strDate)
          Return the number of current product
 java.lang.Integer getCountProductAVenirByDate(java.lang.String strDate)
          Return the number of future product
 java.lang.String getPluginName()
          
 
Methods inherited from class fr.paris.lutece.plugins.stock.commons.dao.AbstractStockDAO
addRestriction, createPagedQuery, findAll
 
Methods inherited from class fr.paris.lutece.portal.service.jpa.JPALuteceDAO
createNativeQuery, getEntityManagerFactory
 
Methods inherited from class fr.paris.lutece.util.jpa.JPAGenericDAO
create, detach, findAll, findById, flush, getEM, getEntityClass, getEntityClassName, remove, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface fr.paris.lutece.plugins.stock.commons.dao.IStockDAO
findAll
 
Methods inherited from interface fr.paris.lutece.util.jpa.IGenericDAO
create, detach, findAll, findById, flush, remove, update
 

Constructor Detail

ProductDAO

public ProductDAO()
Method Detail

getPluginName

public java.lang.String getPluginName()

Specified by:
getPluginName in class fr.paris.lutece.portal.service.jpa.JPALuteceDAO<java.lang.Integer,Product>

findByFilter

public java.util.List<Product> findByFilter(ProductFilter filter)
Find product list by filter.

Specified by:
findByFilter in interface IProductDAO
Parameters:
filter - the filter
Returns:
the list of product

findByFilter

public fr.paris.lutece.plugins.stock.commons.ResultList<Product> findByFilter(ProductFilter filter,
                                                                              fr.paris.lutece.plugins.stock.commons.dao.PaginationProperties paginationProperties)
Finds by filter.

Specified by:
findByFilter in interface IProductDAO
Parameters:
filter - the filter
paginationProperties - the pagination properties
Returns:
the product list

buildPredicates

protected java.util.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.

Parameters:
filter - the filter
root - the product root
builder - the criteria builder
Returns:
the predicate list

buildCriteriaQuery

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.

Parameters:
filter - the filter
root - the category root
query - the criteria query
builder - the criteria builder

buildSortQuery

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.

Parameters:
filter - the filter
root - the product root
query - the criteria query
builder - the criteria builder

getAllByName

public java.util.List<Product> getAllByName(java.lang.String name)
Returns products by name

Specified by:
getAllByName in interface IProductDAO
Parameters:
name - product name
Returns:
products list

getCountProductALAfficheByDate

public java.lang.Integer getCountProductALAfficheByDate(java.lang.String strDate)
Return the number of current product

Specified by:
getCountProductALAfficheByDate in interface IProductDAO
Parameters:
strDate - the current date
Returns:
number of product

getCountProductAVenirByDate

public java.lang.Integer getCountProductAVenirByDate(java.lang.String strDate)
Return the number of future product

Specified by:
getCountProductAVenirByDate in interface IProductDAO
Parameters:
strDate - the current date
Returns:
number of product


Copyright © 2012 Mairie de Paris. All Rights Reserved.