org.synyx.hades.dao
Interface ExtendedGenericDao<T,PK extends java.io.Serializable>

All Superinterfaces:
GenericDao<T,PK>
All Known Implementing Classes:
AbstractExtendedGenericJpaDao, GenericEclipseLinkJpaDao, GenericHibernateJpaDao

public interface ExtendedGenericDao<T,PK extends java.io.Serializable>
extends GenericDao<T,PK>

Interface for a more sophisticated DAO implementation. Mostly the functionality declared here will require an implementation that is based of some proprietary features of certain JPA providers.

Author:
Oliver Gierke

Method Summary
 void deleteByExample(java.util.Collection<T> examples)
          Deletes all entities mathing the given examples.
 void deleteByExample(T... examples)
          Deletes all entities mathing the given examples.
 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.
 Page<T> readByExample(Pageable pageable, 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.
 java.util.List<T> readByExample(Sort sort, T... examples)
          Returns all entites matching the given criteria sorted by the given sort options.
 java.util.List<T> readByExample(T... examples)
          Returns all entities matching the given examples.
 
Methods inherited from interface org.synyx.hades.dao.GenericDao
count, delete, delete, deleteAll, exists, flush, readAll, readAll, readAll, readByPrimaryKey, save, save, saveAndFlush
 

Method Detail

readByExample

java.util.List<T> readByExample(T... examples)
Returns all entities matching the given examples. If you provide more than one example their restrictions will be OR concatenated. If you provide no example at all or null, the call returns the same entities as GenericDao#readAll().

Parameters:
examples -
Returns:
all objects meeting the criterias expressed by the given examples

readByExample

java.util.List<T> readByExample(java.util.Collection<T> examples)
Returns all entites matching the given criteria sorted by the given sort options.

Parameters:
sort -
examples -
Returns:
all entites matching the given criteria sorted by the given sort options
See Also:
readByExample(Object...)

readByExample

java.util.List<T> readByExample(Sort sort,
                                T... examples)
Returns all entites matching the given criteria sorted by the given sort options.

Parameters:
sort -
examples -
Returns:
all entites matching the given criteria sorted by the given sort options
See Also:
readByExample(Object...)

readByExample

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.

Parameters:
sort -
examples -
Returns:
all entites matching the given criteria sorted by the given sort options
See Also:
readByExample(Object...)

readByExample

Page<T> readByExample(Pageable pageable,
                      T... examples)
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...).

Parameters:
pageable -
examples -
Returns:
the page of objects meeting the example's criterias

readByExample

Page<T> readByExample(Pageable pageable,
                      java.util.Collection<T> examples)
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...).

Parameters:
pageable -
examples -
Returns:
the page of objects meeting the example's criterias

deleteByExample

void deleteByExample(T... examples)
Deletes all entities mathing the given examples.

Parameters:
examples -

deleteByExample

void deleteByExample(java.util.Collection<T> examples)
Deletes all entities mathing the given examples.

Parameters:
examples -


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