org.synyx.hades.dao.orm
Class GenericEclipseLinkJpaDao<T,PK extends java.io.Serializable>

java.lang.Object
  extended by org.synyx.hades.dao.orm.GenericDaoSupport<T>
      extended by org.synyx.hades.dao.orm.GenericJpaDao<T,PK>
          extended by org.synyx.hades.dao.orm.AbstractExtendedGenericJpaDao<T,PK>
              extended by org.synyx.hades.dao.orm.GenericEclipseLinkJpaDao<T,PK>
All Implemented Interfaces:
ExtendedGenericDao<T,PK>, GenericDao<T,PK>

public class GenericEclipseLinkJpaDao<T,PK extends java.io.Serializable>
extends AbstractExtendedGenericJpaDao<T,PK>

EclipseLink based implementation of ExtendedGenericDao.

Author:
Oliver Gierke - gierke@synyx.de

Nested Class Summary
 
Nested classes/interfaces inherited from class org.synyx.hades.dao.orm.GenericDaoSupport
GenericDaoSupport.IsNewStrategy, GenericDaoSupport.PersistableIsNewStrategy, GenericDaoSupport.ReflectiveIsNewStrategy
 
Constructor Summary
GenericEclipseLinkJpaDao()
           
 
Method Summary
static
<T extends Persistable<PK>,PK extends java.io.Serializable>
ExtendedGenericDao<T,PK>
create(javax.persistence.EntityManager entityManager, java.lang.Class<T> domainClass)
          Factory method to create GenericEclipseLinkJpaDao instances.
 void deleteByExample(java.util.Collection<T> examples)
          Deletes all entities mathing the given examples.
protected  org.eclipse.persistence.jpa.JpaEntityManager getEntityManager()
          Returns the EntityManager.
 java.util.List<T> readByExample(java.util.Collection<T> examples)
          Returns all entites matching the given criteria sorted by the given sort options.
 Page<T> readByExample(Pageable pageable, java.util.Collection<T> examples)
          Allows pageable access to all entities matching the given examples.
 java.util.List<T> readByExample(Sort sort, java.util.Collection<T> examples)
          Returns all entites matching the given criteria sorted by the given sort options.
 void validate()
          Callback method to validate the class setup.
 
Methods inherited from class org.synyx.hades.dao.orm.AbstractExtendedGenericJpaDao
deleteByExample, readByExample, readByExample, readByExample
 
Methods inherited from class org.synyx.hades.dao.orm.GenericJpaDao
count, delete, delete, deleteAll, exists, flush, readAll, readAll, readAll, readByPrimaryKey, readPage, save, save, saveAndFlush
 
Methods inherited from class org.synyx.hades.dao.orm.GenericDaoSupport
assertEntityManagerClass, createIsNewStrategy, getCountQueryString, getDeleteAllQueryString, getDomainClass, getIsNewStrategy, getReadAllQuery, getReadAllQueryString, setDomainClass, setEntityManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.synyx.hades.dao.GenericDao
count, delete, delete, deleteAll, exists, flush, readAll, readAll, readAll, readByPrimaryKey, save, save, saveAndFlush
 

Constructor Detail

GenericEclipseLinkJpaDao

public GenericEclipseLinkJpaDao()
Method Detail

create

public static <T extends Persistable<PK>,PK extends java.io.Serializable> ExtendedGenericDao<T,PK> create(javax.persistence.EntityManager entityManager,
                                                                                                          java.lang.Class<T> domainClass)
Factory method to create GenericEclipseLinkJpaDao instances.

Type Parameters:
T - the type of the entity to handle
PK - the type of the entity's identifier
Parameters:
entityManager - the EntityManager backing the DAO
domainClass - the domain class to handle
Returns:

readByExample

public java.util.List<T> readByExample(java.util.Collection<T> examples)
Description copied from interface: ExtendedGenericDao
Returns all entites matching the given criteria sorted by the given sort options.

Returns:
all entites matching the given criteria sorted by the given sort options
See Also:
ExtendedGenericDao#readByExample(Persistable...)

readByExample

public java.util.List<T> readByExample(Sort sort,
                                       java.util.Collection<T> examples)
Description copied from interface: ExtendedGenericDao
Returns all entites matching the given criteria sorted by the given sort options.

Returns:
all entites matching the given criteria sorted by the given sort options
See Also:
ExtendedGenericDao#readByExample(Persistable...)

readByExample

public Page<T> readByExample(Pageable pageable,
                             java.util.Collection<T> examples)
Description copied from interface: ExtendedGenericDao
Allows pageable access to all entities matching the given examples. If you provide null for the pageable, the call is identical to ExtendedGenericDao#readByExample(T...).

Returns:
the page of objects meeting the example's criterias

deleteByExample

public void deleteByExample(java.util.Collection<T> examples)
Description copied from interface: ExtendedGenericDao
Deletes all entities mathing the given examples.


getEntityManager

protected org.eclipse.persistence.jpa.JpaEntityManager getEntityManager()
Description copied from class: GenericDaoSupport
Returns the EntityManager.

Overrides:
getEntityManager in class GenericDaoSupport<T>
Returns:

validate

public void validate()
Description copied from class: GenericDaoSupport
Callback method to validate the class setup.

Overrides:
validate in class GenericDaoSupport<T>


Copyright © 2009-2010 Synyx GmbH & Co. KG. All Rights Reserved.