Class BaseJpaRepositoryImpl<T,ID>
java.lang.Object
org.springframework.data.jpa.repository.support.SimpleJpaRepository<T,ID>
io.hypersistence.utils.spring.repository.BaseJpaRepositoryImpl<T,ID>
- All Implemented Interfaces:
BaseJpaRepository<T,,ID> org.springframework.data.jpa.repository.JpaRepository<T,,ID> org.springframework.data.jpa.repository.JpaSpecificationExecutor<T>,org.springframework.data.jpa.repository.support.JpaRepositoryImplementation<T,,ID> org.springframework.data.repository.CrudRepository<T,,ID> org.springframework.data.repository.ListCrudRepository<T,,ID> org.springframework.data.repository.ListPagingAndSortingRepository<T,,ID> org.springframework.data.repository.PagingAndSortingRepository<T,,ID> org.springframework.data.repository.query.QueryByExampleExecutor<T>,org.springframework.data.repository.Repository<T,ID>
public class BaseJpaRepositoryImpl<T,ID>
extends org.springframework.data.jpa.repository.support.SimpleJpaRepository<T,ID>
implements BaseJpaRepository<T,ID>
- Author:
- Vlad Mihalcea
-
Constructor Summary
ConstructorsConstructorDescriptionBaseJpaRepositoryImpl(org.springframework.data.jpa.repository.support.JpaEntityInformation<T, ?> entityInformation, jakarta.persistence.EntityManager entityManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected <R> RexecuteBatch(Supplier<R> callback) protected IntegergetBatchSize(org.hibernate.Session session) Lock the entity with the provided identifier.<S extends T>
Smerge(S entity) The persist method allows you to pass the provided entity to themergemethod of the underlying JPAEntityManager.The mergeAll method allows you to pass the provided entities to themergemethod of the underlying JPAEntityManager.mergeAllAndFlush(Iterable<S> entities) The mergeAllAndFlush method allows you to pass the provided entities to themergemethod of the underlying JPAEntityManagerand callflushafterwards.<S extends T>
SmergeAndFlush(S entity) The mergeAndFlush method allows you to pass the provided entity to themergemethod of the underlying JPAEntityManagerand callflushafterwards.<S extends T>
Spersist(S entity) The persist method allows you to pass the provided entity to thepersistmethod of the underlying JPAEntityManager.persistAll(Iterable<S> entities) The persistAll method allows you to pass the provided entities to thepersistmethod of the underlying JPAEntityManager.persistAllAndFlush(Iterable<S> entities) The persistAll method allows you to pass the provided entities to thepersistmethod of the underlying JPAEntityManagerand callflushafterwards.<S extends T>
SpersistAndFlush(S entity) The persistAndFlush method allows you to pass the provided entity to thepersistmethod of the underlying JPAEntityManagerand callflushafterwards.protected org.hibernate.Sessionsession()<S extends T>
Supdate(S entity) The update method allows you to pass the provided entity to theupdatemethod of the underlying JPAEntityManager.The updateAll method allows you to pass the provided entities to theupdatemethod of the underlying JPAEntityManager.updateAllAndFlush(Iterable<S> entities) The updateAllAndFlush method allows you to pass the provided entities to theupdatemethod of the underlying JPAEntityManagerand callflushafterwards.<S extends T>
SupdateAndFlush(S entity) The updateAndFlush method allows you to pass the provided entity to theupdatemethod of the underlying JPAEntityManagerand callflushafterwards.Methods inherited from class org.springframework.data.jpa.repository.support.SimpleJpaRepository
count, count, count, delete, delete, deleteAll, deleteAll, deleteAllById, deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteById, exists, exists, existsById, findAll, findAll, findAll, findAll, findAll, findAll, findAll, findAll, findAll, findAllById, findBy, findBy, findById, findOne, findOne, flush, getById, getCountQuery, getCountQuery, getDomainClass, getOne, getQuery, getQuery, getQuery, getQuery, getQueryHints, getQueryHintsForCount, getReferenceById, getRepositoryMethodMetadata, readPage, readPage, save, saveAll, saveAllAndFlush, saveAndFlush, setEscapeCharacter, setRepositoryMethodMetadataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.hypersistence.utils.spring.repository.BaseJpaRepository
count, delete, deleteAllByIdInBatch, deleteAllInBatch, deleteById, existsById, findAllById, findById, flush, getReferenceByIdMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteInBatchMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Constructor Details
-
BaseJpaRepositoryImpl
public BaseJpaRepositoryImpl(org.springframework.data.jpa.repository.support.JpaEntityInformation<T, ?> entityInformation, jakarta.persistence.EntityManager entityManager)
-
-
Method Details
-
persist
Description copied from interface:BaseJpaRepositoryThe persist method allows you to pass the provided entity to thepersistmethod of the underlying JPAEntityManager.- Specified by:
persistin interfaceBaseJpaRepository<T,ID> - Type Parameters:
S- entity type- Parameters:
entity- entity to persist- Returns:
- entity
-
persistAndFlush
Description copied from interface:BaseJpaRepositoryThe persistAndFlush method allows you to pass the provided entity to thepersistmethod of the underlying JPAEntityManagerand callflushafterwards.- Specified by:
persistAndFlushin interfaceBaseJpaRepository<T,ID> - Type Parameters:
S- entity type- Parameters:
entity- entity to persist- Returns:
- entity
-
persistAll
Description copied from interface:BaseJpaRepositoryThe persistAll method allows you to pass the provided entities to thepersistmethod of the underlying JPAEntityManager.- Specified by:
persistAllin interfaceBaseJpaRepository<T,ID> - Type Parameters:
S- entity type- Parameters:
entities- entities to persist- Returns:
- entities
-
persistAllAndFlush
Description copied from interface:BaseJpaRepositoryThe persistAll method allows you to pass the provided entities to thepersistmethod of the underlying JPAEntityManagerand callflushafterwards.- Specified by:
persistAllAndFlushin interfaceBaseJpaRepository<T,ID> - Type Parameters:
S- entity type- Parameters:
entities- entities to persist- Returns:
- entities
-
merge
Description copied from interface:BaseJpaRepositoryThe persist method allows you to pass the provided entity to themergemethod of the underlying JPAEntityManager.- Specified by:
mergein interfaceBaseJpaRepository<T,ID> - Type Parameters:
S- entity type- Parameters:
entity- entity to merge- Returns:
- entity
-
mergeAndFlush
Description copied from interface:BaseJpaRepositoryThe mergeAndFlush method allows you to pass the provided entity to themergemethod of the underlying JPAEntityManagerand callflushafterwards.- Specified by:
mergeAndFlushin interfaceBaseJpaRepository<T,ID> - Type Parameters:
S- entity type- Parameters:
entity- entity to merge- Returns:
- entity
-
mergeAll
Description copied from interface:BaseJpaRepositoryThe mergeAll method allows you to pass the provided entities to themergemethod of the underlying JPAEntityManager.- Specified by:
mergeAllin interfaceBaseJpaRepository<T,ID> - Type Parameters:
S- entity type- Parameters:
entities- entities to merge- Returns:
- entities
-
mergeAllAndFlush
Description copied from interface:BaseJpaRepositoryThe mergeAllAndFlush method allows you to pass the provided entities to themergemethod of the underlying JPAEntityManagerand callflushafterwards.- Specified by:
mergeAllAndFlushin interfaceBaseJpaRepository<T,ID> - Type Parameters:
S- entity type- Parameters:
entities- entities to persist- Returns:
- entities
-
update
Description copied from interface:BaseJpaRepositoryThe update method allows you to pass the provided entity to theupdatemethod of the underlying JPAEntityManager.- Specified by:
updatein interfaceBaseJpaRepository<T,ID> - Type Parameters:
S- entity type- Parameters:
entity- entity to update- Returns:
- entity
-
updateAndFlush
Description copied from interface:BaseJpaRepositoryThe updateAndFlush method allows you to pass the provided entity to theupdatemethod of the underlying JPAEntityManagerand callflushafterwards.- Specified by:
updateAndFlushin interfaceBaseJpaRepository<T,ID> - Type Parameters:
S- entity type- Parameters:
entity- entity to update- Returns:
- entity
-
updateAll
Description copied from interface:BaseJpaRepositoryThe updateAll method allows you to pass the provided entities to theupdatemethod of the underlying JPAEntityManager.- Specified by:
updateAllin interfaceBaseJpaRepository<T,ID> - Type Parameters:
S- entity type- Parameters:
entities- entities to update- Returns:
- entities
-
updateAllAndFlush
Description copied from interface:BaseJpaRepositoryThe updateAllAndFlush method allows you to pass the provided entities to theupdatemethod of the underlying JPAEntityManagerand callflushafterwards.- Specified by:
updateAllAndFlushin interfaceBaseJpaRepository<T,ID> - Type Parameters:
S- entity type- Parameters:
entities- entities to update- Returns:
- entities
-
lockById
Description copied from interface:BaseJpaRepositoryLock the entity with the provided identifier.- Specified by:
lockByIdin interfaceBaseJpaRepository<T,ID> - Parameters:
id- entity identifierlockMode- entity lock mode- Returns:
- entity
-
getBatchSize
-
executeBatch
-
session
protected org.hibernate.Session session()
-