Interface HibernateRepository<T>
- All Known Implementing Classes:
HibernateRepositoryImpl
public interface HibernateRepository<T>
The
HibernateRepository
fixes the problems that the default Spring Data JpaRepository
suffers from.
For more details about how to use it, check out this article.
- Version:
- 2.17.0
- Author:
- Vlad Mihalcea
-
Method Summary
Modifier and TypeMethodDescriptionfindAll()
Deprecated.<S extends T>
Smerge
(S entity) The persist method allows you to pass the provided entity to themerge
method of the underlying JPAEntityManager
.The mergeAll method allows you to pass the provided entities to themerge
method of the underlying JPAEntityManager
.mergeAllAndFlush
(Iterable<S> entities) The mergeAllAndFlush method allows you to pass the provided entities to themerge
method of the underlying JPAEntityManager
and callflush
afterwards.<S extends T>
SmergeAndFlush
(S entity) The mergeAndFlush method allows you to pass the provided entity to themerge
method of the underlying JPAEntityManager
and callflush
afterwards.<S extends T>
Spersist
(S entity) The persist method allows you to pass the provided entity to thepersist
method of the underlying JPAEntityManager
.persistAll
(Iterable<S> entities) The persistAll method allows you to pass the provided entities to thepersist
method of the underlying JPAEntityManager
.persistAllAndFlush
(Iterable<S> entities) The persistAll method allows you to pass the provided entities to thepersist
method of the underlying JPAEntityManager
and callflush
afterwards.<S extends T>
SpersistAndFlush
(S entity) The persistAndFlush method allows you to pass the provided entity to thepersist
method of the underlying JPAEntityManager
and callflush
afterwards.<S extends T>
Ssave
(S entity) Deprecated.Deprecated.saveAllAndFlush
(Iterable<S> entities) Deprecated.<S extends T>
SsaveAndFlush
(S entity) Deprecated.<S extends T>
Supdate
(S entity) The update method allows you to pass the provided entity to theupdate
method of the underlying JPAEntityManager
.The updateAll method allows you to pass the provided entities to theupdate
method of the underlying JPAEntityManager
.updateAllAndFlush
(Iterable<S> entities) The updateAllAndFlush method allows you to pass the provided entities to theupdate
method of the underlying JPAEntityManager
and callflush
afterwards.<S extends T>
SupdateAndFlush
(S entity) The updateAndFlush method allows you to pass the provided entity to theupdate
method of the underlying JPAEntityManager
and callflush
afterwards.
-
Method Details
-
findAll
Deprecated.The findAll method is a terrible Anti-Pattern.For more details about why you should not use the
findAll
method by default, check out this article.- Returns:
- all the records from the database table this entity is mapped to
-
save
Deprecated.The save method should be avoided.For more details about how to use it, check out this article.
-
saveAll
Deprecated.The save method should be avoided.For more details about how to use it, check out this article.
-
saveAndFlush
Deprecated.The saveAndFlush method should be avoided.For more details about how to use it, check out this article.
-
saveAllAndFlush
Deprecated.The saveAllAndFlush method should be avoided.For more details about how to use it, check out this article.
-
persist
The persist method allows you to pass the provided entity to thepersist
method of the underlying JPAEntityManager
.- Type Parameters:
S
- entity type- Parameters:
entity
- entity to persist- Returns:
- entity
-
persistAndFlush
The persistAndFlush method allows you to pass the provided entity to thepersist
method of the underlying JPAEntityManager
and callflush
afterwards.- Type Parameters:
S
- entity type- Parameters:
entity
- entity to persist- Returns:
- entity
-
persistAll
The persistAll method allows you to pass the provided entities to thepersist
method of the underlying JPAEntityManager
.- Type Parameters:
S
- entity type- Parameters:
entities
- entities to persist- Returns:
- entities
-
persistAllAndFlush
The persistAll method allows you to pass the provided entities to thepersist
method of the underlying JPAEntityManager
and callflush
afterwards.- Type Parameters:
S
- entity type- Parameters:
entities
- entities to persist- Returns:
- entities
-
merge
The persist method allows you to pass the provided entity to themerge
method of the underlying JPAEntityManager
.- Type Parameters:
S
- entity type- Parameters:
entity
- entity to merge- Returns:
- entity
-
mergeAndFlush
The mergeAndFlush method allows you to pass the provided entity to themerge
method of the underlying JPAEntityManager
and callflush
afterwards.- Type Parameters:
S
- entity type- Parameters:
entity
- entity to merge- Returns:
- entity
-
mergeAll
The mergeAll method allows you to pass the provided entities to themerge
method of the underlying JPAEntityManager
.- Type Parameters:
S
- entity type- Parameters:
entities
- entities to merge- Returns:
- entities
-
mergeAllAndFlush
The mergeAllAndFlush method allows you to pass the provided entities to themerge
method of the underlying JPAEntityManager
and callflush
afterwards.- Type Parameters:
S
- entity type- Parameters:
entities
- entities to persist- Returns:
- entities
-
update
The update method allows you to pass the provided entity to theupdate
method of the underlying JPAEntityManager
.- Type Parameters:
S
- entity type- Parameters:
entity
- entity to update- Returns:
- entity
-
updateAndFlush
The updateAndFlush method allows you to pass the provided entity to theupdate
method of the underlying JPAEntityManager
and callflush
afterwards.- Type Parameters:
S
- entity type- Parameters:
entity
- entity to update- Returns:
- entity
-
updateAll
The updateAll method allows you to pass the provided entities to theupdate
method of the underlying JPAEntityManager
.- Type Parameters:
S
- entity type- Parameters:
entities
- entities to update- Returns:
- entities
-
updateAllAndFlush
The updateAllAndFlush method allows you to pass the provided entities to theupdate
method of the underlying JPAEntityManager
and callflush
afterwards.- Type Parameters:
S
- entity type- Parameters:
entities
- entities to update- Returns:
- entities
-