@NoRepositoryBean public interface JpaRepository<T,ID> extends PagingAndSortingRepository<T,ID>, QueryByExampleExecutor<T>
Repository
.Modifier and Type | Method and Description |
---|---|
void |
deleteAllByIdInBatch(Iterable<ID> ids)
Deletes the entities identified by the given ids using a single query.
|
void |
deleteAllInBatch()
Deletes all entities in a batch call.
|
void |
deleteAllInBatch(Iterable<T> entities)
Deletes the given entities in a batch which means it will create a single query.
|
default void |
deleteInBatch(Iterable<T> entities)
Deprecated.
Use
deleteAllInBatch(Iterable) instead. |
List<T> |
findAll() |
<S extends T> |
findAll(Example<S> example) |
<S extends T> |
findAll(Example<S> example,
Sort sort) |
List<T> |
findAll(Sort sort) |
List<T> |
findAllById(Iterable<ID> ids) |
void |
flush()
Flushes all pending changes to the database.
|
T |
getById(ID id)
Returns a reference to the entity with the given identifier.
|
T |
getOne(ID id)
Deprecated.
use
JpaRepository#getById(ID) instead. |
<S extends T> |
saveAll(Iterable<S> entities) |
<S extends T> |
saveAllAndFlush(Iterable<S> entities)
Saves all entities and flushes changes instantly.
|
<S extends T> |
saveAndFlush(S entity)
Saves an entity and flushes changes instantly.
|
findAll
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save
count, exists, findAll, findOne
List<T> findAll(Sort sort)
findAll
in interface PagingAndSortingRepository<T,ID>
List<T> findAllById(Iterable<ID> ids)
findAllById
in interface CrudRepository<T,ID>
<S extends T> List<S> saveAll(Iterable<S> entities)
saveAll
in interface CrudRepository<T,ID>
void flush()
<S extends T> S saveAndFlush(S entity)
entity
- entity to be saved. Must not be null.<S extends T> List<S> saveAllAndFlush(Iterable<S> entities)
entities
- entities to be deleted. Must not be null.@Deprecated default void deleteInBatch(Iterable<T> entities)
deleteAllInBatch(Iterable)
instead.EntityManager
before calling this
method.entities
- entities to be deleted. Must not be null.void deleteAllInBatch(Iterable<T> entities)
EntityManager
before calling this
method.entities
- entities to be deleted. Must not be null.void deleteAllByIdInBatch(Iterable<ID> ids)
EntityManager
before calling this method.ids
- the ids of the entities to be deleted. Must not be null.void deleteAllInBatch()
@Deprecated T getOne(ID id)
JpaRepository#getById(ID)
instead.EntityNotFoundException
on first access. Some of them will reject invalid identifiers
immediately.id
- must not be null.for details on when an exception is thrown.
T getById(ID id)
EntityNotFoundException
on first access. Some of them will reject invalid identifiers
immediately.id
- must not be null.for details on when an exception is thrown.
<S extends T> List<S> findAll(Example<S> example)
findAll
in interface QueryByExampleExecutor<T>
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.