Interface RidRepository
- All Superinterfaces:
BaseRepository<Rid,,Integer> org.springframework.data.repository.CrudRepository<Rid,,Integer> org.springframework.data.jpa.repository.JpaRepository<Rid,,Integer> org.springframework.data.repository.ListCrudRepository<Rid,,Integer> org.springframework.data.repository.ListPagingAndSortingRepository<Rid,,Integer> org.springframework.data.repository.PagingAndSortingRepository<Rid,,Integer> org.springframework.data.repository.query.QueryByExampleExecutor<Rid>,org.springframework.data.repository.Repository<Rid,Integer>
Rid Generator repository.
- Since:
- 1.0.0
- Author:
- Ritesh Sinha, Abhishek Kumar
-
Method Summary
Modifier and TypeMethodDescriptionMethod to fetch last updated sequence no.intupdateRid(int currentId, int previousId) Method to update previous sequence no.Methods inherited from interface io.mosip.kernel.core.dataaccess.spi.repository.BaseRepository
create, createNamedQuerySelect, createNamedQueryUpdateOrDelete, createQuerySelect, createQuerySelect, createQueryUpdateOrDelete, delete, findAll, findById, updateMethods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findLastRid
@Query(value="select r.curr_seq_no, r.cr_by, r.cr_dtimes, r.upd_by, r.upd_dtimes FROM rid_seq r ", nativeQuery=true) Rid findLastRid()Method to fetch last updated sequence no.- Returns:
- the entity.
-
updateRid
@Modifying @Transactional @Query("UPDATE Rid SET currentSequenceNo=?1 WHERE currentSequenceNo=?2") int updateRid(int currentId, int previousId) Method to update previous sequence no.- Parameters:
currentId- the current sequence no.previousId- the previous sequence no.- Returns:
- the number of rows updated.
-