Spring Data Jpa

org.springframework.data.jpa.repository.support
Class QueryDslJpaRepository<T,ID extends Serializable>

java.lang.Object
  extended by org.springframework.data.jpa.repository.support.SimpleJpaRepository<T,ID>
      extended by org.springframework.data.jpa.repository.support.QueryDslJpaRepository<T,ID>
All Implemented Interfaces:
JpaRepository<T,ID>, JpaSpecificationExecutor<T>, QueryDslPredicateExecutor<T>, CrudRepository<T,ID>, PagingAndSortingRepository<T,ID>, Repository<T,ID>

public class QueryDslJpaRepository<T,ID extends Serializable>
extends SimpleJpaRepository<T,ID>
implements QueryDslPredicateExecutor<T>

QueryDsl specific extension of SimpleJpaRepository which adds implementation for QueryDslPredicateExecutor.

Author:
Oliver Gierke

Constructor Summary
QueryDslJpaRepository(JpaEntityInformation<T,ID> entityInformation, javax.persistence.EntityManager entityManager)
          Creates a new QueryDslJpaRepository from the given domain class and EntityManager.
QueryDslJpaRepository(JpaEntityInformation<T,ID> entityInformation, javax.persistence.EntityManager entityManager, EntityPathResolver resolver)
          Creates a new QueryDslJpaRepository from the given domain class and EntityManager and uses the given EntityPathResolver to translate the domain class into an EntityPath.
 
Method Summary
 long count(com.mysema.query.types.Predicate predicate)
           
protected  com.mysema.query.jpa.JPQLQuery createQuery(com.mysema.query.types.Predicate... predicate)
          Creates a new JPQLQuery for the given Predicate.
 List<T> findAll(com.mysema.query.types.Predicate predicate)
           
 List<T> findAll(com.mysema.query.types.Predicate predicate, com.mysema.query.types.OrderSpecifier<?>... orders)
           
 Page<T> findAll(com.mysema.query.types.Predicate predicate, Pageable pageable)
           
 T findOne(com.mysema.query.types.Predicate predicate)
           
 
Methods inherited from class org.springframework.data.jpa.repository.support.SimpleJpaRepository
count, count, delete, delete, delete, deleteAll, deleteAllInBatch, deleteInBatch, exists, findAll, findAll, findAll, findAll, findAll, findAll, findAll, findOne, findOne, flush, save, save, saveAndFlush, setLockMetadataProvider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryDslJpaRepository

public QueryDslJpaRepository(JpaEntityInformation<T,ID> entityInformation,
                             javax.persistence.EntityManager entityManager)
Creates a new QueryDslJpaRepository from the given domain class and EntityManager. This will use the SimpleEntityPathResolver to translate the given domain class into an EntityPath.

Parameters:
entityInformation - must not be null.
entityManager - must not be null.

QueryDslJpaRepository

public QueryDslJpaRepository(JpaEntityInformation<T,ID> entityInformation,
                             javax.persistence.EntityManager entityManager,
                             EntityPathResolver resolver)
Creates a new QueryDslJpaRepository from the given domain class and EntityManager and uses the given EntityPathResolver to translate the domain class into an EntityPath.

Parameters:
entityInformation - must not be null.
entityManager - must not be null.
resolver - must not be null.
Method Detail

findOne

public T findOne(com.mysema.query.types.Predicate predicate)
Specified by:
findOne in interface QueryDslPredicateExecutor<T>

findAll

public List<T> findAll(com.mysema.query.types.Predicate predicate)
Specified by:
findAll in interface QueryDslPredicateExecutor<T>

findAll

public List<T> findAll(com.mysema.query.types.Predicate predicate,
                       com.mysema.query.types.OrderSpecifier<?>... orders)
Specified by:
findAll in interface QueryDslPredicateExecutor<T>

findAll

public Page<T> findAll(com.mysema.query.types.Predicate predicate,
                       Pageable pageable)
Specified by:
findAll in interface QueryDslPredicateExecutor<T>

count

public long count(com.mysema.query.types.Predicate predicate)
Specified by:
count in interface QueryDslPredicateExecutor<T>

createQuery

protected com.mysema.query.jpa.JPQLQuery createQuery(com.mysema.query.types.Predicate... predicate)
Creates a new JPQLQuery for the given Predicate.

Parameters:
predicate -
Returns:
the Querydsl JPQLQuery.

Spring Data Jpa

Copyright © 2011-2012-2012 SpringSource. All Rights Reserved.