fr.paris.lutece.plugins.stock.business
Class AbstractProductDAO<K,P extends Product,F extends ProductFilter,P_ extends Product_>

java.lang.Object
  extended by fr.paris.lutece.util.jpa.JPAGenericDAO<K,E>
      extended by fr.paris.lutece.portal.service.jpa.JPALuteceDAO<K,P>
          extended by fr.paris.lutece.plugins.stock.business.AbstractProductDAO<K,P,F,P_>
Type Parameters:
F - the product filter
K - the primary key
P - the product
P_ - the product metamodel
All Implemented Interfaces:
IProductDAO<K,P,F>, fr.paris.lutece.util.jpa.IGenericDAO<K,P>
Direct Known Subclasses:
AbstractTicketProductDAO, ProductDAO

public class AbstractProductDAO<K,P extends Product,F extends ProductFilter,P_ extends Product_>
extends fr.paris.lutece.portal.service.jpa.JPALuteceDAO<K,P>
implements IProductDAO<K,P,F>

This class provides Data Access methods for Person objects


Constructor Summary
AbstractProductDAO()
          Constructor
 
Method Summary
protected  java.util.List<javax.persistence.criteria.Predicate> buildPredicates(F filter, javax.persistence.criteria.Root<P> root, javax.persistence.criteria.CriteriaBuilder builder)
          Build the predicate list from filter
protected  void buildSortQuery(F filter, javax.persistence.criteria.Root<P> root, javax.persistence.criteria.CriteriaQuery<P> query, javax.persistence.criteria.CriteriaBuilder builder)
          Build the sort query
 java.util.List<P> findByFilter(F filter)
          Find product list by filter
 java.lang.String getPluginName()
          
 java.lang.Class<P> getProductClass()
          Get the product P class
 
Methods inherited from class fr.paris.lutece.portal.service.jpa.JPALuteceDAO
createNativeQuery, getEntityManagerFactory
 
Methods inherited from class fr.paris.lutece.util.jpa.JPAGenericDAO
create, findAll, findById, 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.util.jpa.IGenericDAO
create, findAll, findById, remove, update
 

Constructor Detail

AbstractProductDAO

public AbstractProductDAO()
Constructor

Method Detail

getPluginName

public java.lang.String getPluginName()

Specified by:
getPluginName in class fr.paris.lutece.portal.service.jpa.JPALuteceDAO<K,P extends Product>

getProductClass

public java.lang.Class<P> getProductClass()
Get the product P class

Returns:
the class

findByFilter

public java.util.List<P> findByFilter(F filter)
Find product list by filter

Specified by:
findByFilter in interface IProductDAO<K,P extends Product,F extends ProductFilter>
Parameters:
filter - the filter
Returns:
the list of product

buildPredicates

protected java.util.List<javax.persistence.criteria.Predicate> buildPredicates(F filter,
                                                                               javax.persistence.criteria.Root<P> 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

buildSortQuery

protected void buildSortQuery(F filter,
                              javax.persistence.criteria.Root<P> root,
                              javax.persistence.criteria.CriteriaQuery<P> 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


Copyright © 2011 Mairie de Paris. All Rights Reserved.