添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
All Superinterfaces:
CrudRepository <T, ID> , ListCrudRepository <T, ID> , ListPagingAndSortingRepository <T, ID> , PagingAndSortingRepository <T, ID> , QueryByExampleExecutor <T> , Repository <T, ID>
All Known Subinterfaces:
EnversRevisionRepository <T, ID, N> , JpaRepositoryImplementation <T, ID>
All Known Implementing Classes:
QuerydslJpaRepository , SimpleJpaRepository
@NoRepositoryBean public interface JpaRepository<T, ID> extends ListCrudRepository <T, ID>, ListPagingAndSortingRepository <T, ID>, QueryByExampleExecutor <T>
JPA specific extension of Repository .
Author:
Oliver Gierke, Christoph Strobl, Mark Paluch, Sander Krabbenborg, Jesse Wouters, Greg Turnquist, Jens Schauder

Method Summary

Modifier and Type
Method
Description
Deletes the entities identified by the given ids using a single query.
Deletes all entities in a batch call.
Deletes the given entities in a batch which means it will create a single query.
default void
Deprecated.
<S extends T >
List <S>
findAll ( Example <S> example)
<S extends T >
List <S>
findAll ( Example <S> example, Sort sort)
Flushes all pending changes to the database.
Deprecated.
Deprecated.
Returns a reference to the entity with the given identifier.
<S extends T >
List <S>
Saves all entities and flushes changes instantly.
<S extends T >
S
saveAndFlush (S entity)
Saves an entity and flushes changes instantly.

Methods inherited from interface org.springframework.data.repository. CrudRepository

count , delete , deleteAll , deleteAll , deleteAllById , deleteById , existsById , findById , save

Methods inherited from interface org.springframework.data.repository. ListCrudRepository

findAll , findAllById , saveAll

Methods inherited from interface org.springframework.data.repository. ListPagingAndSortingRepository

findAll

Methods inherited from interface org.springframework.data.repository. PagingAndSortingRepository

findAll

Methods inherited from interface org.springframework.data.repository.query. QueryByExampleExecutor

count , exists , findAll , findBy , findOne

saveAndFlush

<S extends T > S saveAndFlush (S entity)
Saves an entity and flushes changes instantly.
Parameters:
entity - entity to be saved. Must not be null.
Returns:
the saved entity

saveAllAndFlush

<S extends T > List <S> saveAllAndFlush ( Iterable <S> entities)
Saves all entities and flushes changes instantly.
Parameters:
entities - entities to be saved. Must not be null.
Returns:
the saved entities
Since:
default void deleteInBatch ( Iterable < T > entities)
Deprecated.
Deletes the given entities in a batch which means it will create a single query. This kind of operation leaves JPAs first level cache and the database out of sync. Consider flushing the EntityManager before calling this method.
Parameters:
entities - entities to be deleted. Must not be null.

deleteAllInBatch

void deleteAllInBatch ( Iterable < T > entities)
Deletes the given entities in a batch which means it will create a single query. This kind of operation leaves JPAs first level cache and the database out of sync. Consider flushing the EntityManager before calling this method.
Parameters:
entities - entities to be deleted. Must not be null.
Since:

deleteAllByIdInBatch

void deleteAllByIdInBatch ( Iterable < ID > ids)
Deletes the entities identified by the given ids using a single query. This kind of operation leaves JPAs first level cache and the database out of sync. Consider flushing the EntityManager before calling this method.
Parameters:
ids - the ids of the entities to be deleted. Must not be null.
Since:
Returns a reference to the entity with the given identifier. Depending on how the JPA persistence provider is implemented this is very likely to always return an instance and throw an EntityNotFoundException on first access. Some of them will reject invalid identifiers immediately.
Parameters:
id - must not be null.
Returns:
a reference to the entity with the given identifier.
See Also:
  • for details on when an exception is thrown.
  • Returns a reference to the entity with the given identifier. Depending on how the JPA persistence provider is implemented this is very likely to always return an instance and throw an EntityNotFoundException on first access. Some of them will reject invalid identifiers immediately.
    Parameters:
    id - must not be null.
    Returns:
    a reference to the entity with the given identifier.
    Since:
    See Also:
  • for details on when an exception is thrown.
  • getReferenceById

    T getReferenceById ( ID id)
    Returns a reference to the entity with the given identifier. Depending on how the JPA persistence provider is implemented this is very likely to always return an instance and throw an EntityNotFoundException on first access. Some of them will reject invalid identifiers immediately.
    Parameters:
    id - must not be null.
    Returns:
    a reference to the entity with the given identifier.
    Since:
    See Also:
  • for details on when an exception is thrown.
  •