@NoRepositoryBean
public interface JpaRepository<T,ID>
extends org.springframework.data.repository.PagingAndSortingRepository<T,ID>, org.springframework.data.repository.query.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(org.springframework.data.domain.Example<S> example) |
<S extends T> |
findAll(org.springframework.data.domain.Example<S> example,
org.springframework.data.domain.Sort sort) |
List<T> |
findAll(org.springframework.data.domain.Sort sort) |
List<T> |
findAllById(Iterable<ID> ids) |
void |
flush()
Flushes all pending changes to the database.
|
T |
getById(ID id)
Deprecated.
use
JpaRepository#getReferenceById(ID) instead. |
T |
getOne(ID id)
Deprecated.
use
JpaRepository#getReferenceById(ID) instead. |
T |
getReferenceById(ID id)
Returns a reference to the entity with the given identifier.
|
<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
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 saved. 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#getReferenceById(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.
@Deprecated T getById(ID id)
JpaRepository#getReferenceById(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 getReferenceById(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(org.springframework.data.domain.Example<S> example)
findAll
in interface org.springframework.data.repository.query.QueryByExampleExecutor<T>
Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.