fr.paris.lutece.plugins.stock.commons.dao
Class AbstractStockDAO<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<K,E>
Type Parameters:
K - the key type
E - the entity type
All Implemented Interfaces:
fr.paris.lutece.util.jpa.IGenericDAO<K,E>

public abstract class AbstractStockDAO<K,E>
extends fr.paris.lutece.portal.service.jpa.JPALuteceDAO<K,E>

Abstract class for stock DAO.

Author:
abataille

Constructor Summary
AbstractStockDAO()
           
 
Method Summary
protected  void addRestriction(javax.persistence.criteria.CriteriaQuery<?> query, javax.persistence.criteria.Expression<java.lang.Boolean> exp)
          Add a predicate to an existing query
protected
<T> PagedQuery
createPagedQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery, PaginationProperties paginationProperties)
          Generate count query from criteria query and return a paged query.
 ResultList<E> findAll(PaginationProperties paginationProperties)
          Return all entities paged.
 
Methods inherited from class fr.paris.lutece.portal.service.jpa.JPALuteceDAO
createNativeQuery, getEntityManagerFactory, getPluginName
 
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
 

Constructor Detail

AbstractStockDAO

public AbstractStockDAO()
Method Detail

createPagedQuery

protected <T> PagedQuery createPagedQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery,
                                          PaginationProperties paginationProperties)
Generate count query from criteria query and return a paged query.

Type Parameters:
T - the generic type of criteria query
Parameters:
criteriaQuery - criteria query
paginationProperties - pagination data
Returns:
query paged

findAll

public ResultList<E> findAll(PaginationProperties paginationProperties)
Return all entities paged.

Parameters:
paginationProperties - properties for pagination
Returns:
the result list

addRestriction

protected void addRestriction(javax.persistence.criteria.CriteriaQuery<?> query,
                              javax.persistence.criteria.Expression<java.lang.Boolean> exp)
Add a predicate to an existing query

Parameters:
query - existing query
exp - restriction


Copyright © 2012 Mairie de Paris. All Rights Reserved.