Spring Data Jpa

org.springframework.data.jpa.repository
Interface JpaRepository<T,ID extends Serializable>

All Superinterfaces:
CrudRepository<T,ID>, PagingAndSortingRepository<T,ID>, Repository<T,ID>
All Known Implementing Classes:
QueryDslJpaRepository, SimpleJpaRepository

public interface JpaRepository<T,ID extends Serializable>
extends PagingAndSortingRepository<T,ID>

JPA specific extension of Repository.

Author:
Oliver Gierke

Method Summary
 void deleteInBatch(Iterable<T> entities)
          Deletes the given entities in a batch which means it will create a single Query.
 List<T> findAll()
           
 List<T> findAll(Sort sort)
           
 void flush()
          Flushes all pending changes to the database.
 List<T> save(Iterable<? extends T> entities)
           
 T saveAndFlush(T entity)
          Saves an entity and flushes changes instantly.
 
Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAll
 
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, delete, delete, deleteAll, exists, findOne, save
 

Method Detail

findAll

List<T> findAll()
Specified by:
findAll in interface CrudRepository<T,ID extends Serializable>

findAll

List<T> findAll(Sort sort)
Specified by:
findAll in interface PagingAndSortingRepository<T,ID extends Serializable>

save

List<T> save(Iterable<? extends T> entities)
Specified by:
save in interface CrudRepository<T,ID extends Serializable>

flush

void flush()
Flushes all pending changes to the database.


saveAndFlush

T saveAndFlush(T entity)
Saves an entity and flushes changes instantly.

Parameters:
entity -
Returns:
the saved entity

deleteInBatch

void deleteInBatch(Iterable<T> entities)
Deletes the given entities in a batch which means it will create a single Query. Assume that we will clear the EntityManager after the call.

Parameters:
entities -

Spring Data Jpa

Copyright © 2011-2012 SpringSource. All Rights Reserved.