Spring Data Jpa

org.springframework.data.jpa.repository
Interface JpaSpecificationExecutor<T>

All Known Implementing Classes:
QueryDslJpaRepository, SimpleJpaRepository

public interface JpaSpecificationExecutor<T>

Interface to allow execution of Specifications based on the JPA criteria API.

Author:
Oliver Gierke

Method Summary
 long count(Specification<T> spec)
          Returns the number of instances that the given Specification will return.
 List<T> findAll(Specification<T> spec)
          Returns all entities matching the given Specification.
 Page<T> findAll(Specification<T> spec, Pageable pageable)
          Returns a Page of entities matching the given Specification.
 List<T> findAll(Specification<T> spec, Sort sort)
          Returns all entities matching the given Specification and Sort.
 T findOne(Specification<T> spec)
          Returns a single entity matching the given Specification.
 

Method Detail

findOne

T findOne(Specification<T> spec)
Returns a single entity matching the given Specification.

Parameters:
spec -
Returns:

findAll

List<T> findAll(Specification<T> spec)
Returns all entities matching the given Specification.

Parameters:
spec -
Returns:

findAll

Page<T> findAll(Specification<T> spec,
                Pageable pageable)
Returns a Page of entities matching the given Specification.

Parameters:
spec -
pageable -
Returns:

findAll

List<T> findAll(Specification<T> spec,
                Sort sort)
Returns all entities matching the given Specification and Sort.

Parameters:
spec -
sort -
Returns:

count

long count(Specification<T> spec)
Returns the number of instances that the given Specification will return.

Parameters:
spec - the Specification to count instances for
Returns:
the number of instances

Spring Data Jpa

Copyright © 2011-2012 SpringSource. All Rights Reserved.