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.
 org.springframework.data.domain.Page<T> findAll(Specification<T> spec, org.springframework.data.domain.Pageable pageable)
          Returns a Page of entities matching the given Specification.
 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

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

Parameters:
spec -
pageable -
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 SpringSource. All Rights Reserved.