@NoRepositoryBean
public interface BaseJpaRepository<T,ID>
extends org.springframework.data.repository.Repository<T,ID>, org.springframework.data.repository.query.QueryByExampleExecutor<T>
BaseJpaRepository fixes many of the problems that the default Spring Data JpaRepository
suffers from.
For more details about how to use it, check out this article on vladmihalcea.com.
| Modifier and Type | Method and Description |
|---|---|
long |
count() |
void |
delete(T entity) |
void |
deleteAllByIdInBatch(Iterable<ID> ids) |
void |
deleteAllInBatch(Iterable<T> entities) |
void |
deleteById(ID id) |
boolean |
existsById(ID id) |
List<T> |
findAllById(Iterable<ID> ids) |
Optional<T> |
findById(ID id) |
void |
flush() |
T |
getReferenceById(ID id) |
T |
lockById(ID id,
javax.persistence.LockModeType lockMode)
Lock the entity with the provided identifier.
|
<S extends T> |
merge(S entity)
The persist method allows you to pass the provided entity to the
merge method of the
underlying JPA EntityManager. |
<S extends T> |
mergeAll(Iterable<S> entities)
The mergeAll method allows you to pass the provided entities to the
merge method of the
underlying JPA EntityManager. |
<S extends T> |
mergeAllAndFlush(Iterable<S> entities)
The mergeAllAndFlush method allows you to pass the provided entities to the
merge method of the
underlying JPA EntityManager and call flush afterwards. |
<S extends T> |
mergeAndFlush(S entity)
The mergeAndFlush method allows you to pass the provided entity to the
merge method of the
underlying JPA EntityManager and call flush afterwards. |
<S extends T> |
persist(S entity)
The persist method allows you to pass the provided entity to the
persist method of the
underlying JPA EntityManager. |
<S extends T> |
persistAll(Iterable<S> entities)
The persistAll method allows you to pass the provided entities to the
persist method of the
underlying JPA EntityManager. |
<S extends T> |
persistAllAndFlush(Iterable<S> entities)
The persistAll method allows you to pass the provided entities to the
persist method of the
underlying JPA EntityManager and call flush afterwards. |
<S extends T> |
persistAndFlush(S entity)
The persistAndFlush method allows you to pass the provided entity to the
persist method of the
underlying JPA EntityManager and call flush afterwards. |
<S extends T> |
update(S entity)
The update method allows you to pass the provided entity to the
update method of the
underlying JPA EntityManager. |
<S extends T> |
updateAll(Iterable<S> entities)
The updateAll method allows you to pass the provided entities to the
update method of the
underlying JPA EntityManager. |
<S extends T> |
updateAllAndFlush(Iterable<S> entities)
The updateAllAndFlush method allows you to pass the provided entities to the
update method of the
underlying JPA EntityManager and call flush afterwards. |
<S extends T> |
updateAndFlush(S entity)
The updateAndFlush method allows you to pass the provided entity to the
update method of the
underlying JPA EntityManager and call flush afterwards. |
boolean existsById(ID id)
long count()
void delete(T entity)
void deleteById(ID id)
void flush()
<S extends T> S persist(S entity)
persist method of the
underlying JPA EntityManager.S - entity typeentity - entity to persist<S extends T> S persistAndFlush(S entity)
persist method of the
underlying JPA EntityManager and call flush afterwards.S - entity typeentity - entity to persist<S extends T> List<S> persistAll(Iterable<S> entities)
persist method of the
underlying JPA EntityManager.S - entity typeentities - entities to persist<S extends T> List<S> persistAllAndFlush(Iterable<S> entities)
persist method of the
underlying JPA EntityManager and call flush afterwards.S - entity typeentities - entities to persist<S extends T> S merge(S entity)
merge method of the
underlying JPA EntityManager.S - entity typeentity - entity to merge<S extends T> S mergeAndFlush(S entity)
merge method of the
underlying JPA EntityManager and call flush afterwards.S - entity typeentity - entity to merge<S extends T> List<S> mergeAll(Iterable<S> entities)
merge method of the
underlying JPA EntityManager.S - entity typeentities - entities to merge<S extends T> List<S> mergeAllAndFlush(Iterable<S> entities)
merge method of the
underlying JPA EntityManager and call flush afterwards.S - entity typeentities - entities to persist<S extends T> S update(S entity)
update method of the
underlying JPA EntityManager.S - entity typeentity - entity to update<S extends T> S updateAndFlush(S entity)
update method of the
underlying JPA EntityManager and call flush afterwards.S - entity typeentity - entity to update<S extends T> List<S> updateAll(Iterable<S> entities)
update method of the
underlying JPA EntityManager.S - entity typeentities - entities to update<S extends T> List<S> updateAllAndFlush(Iterable<S> entities)
update method of the
underlying JPA EntityManager and call flush afterwards.S - entity typeentities - entities to updateCopyright © 2024. All rights reserved.