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.PagingAndSortingRepository<Rid,Integer>,org.springframework.data.repository.query.QueryByExampleExecutor<Rid>,org.springframework.data.repository.Repository<Rid,Integer>
@Repository public interface RidRepository extends BaseRepository<Rid,Integer>
Rid Generator repository.- Since:
- 1.0.0
- Author:
- Ritesh Sinha, Abhishek Kumar
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RidfindLastRid()Method 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, update
-
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteById, existsById, findById, save
-
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getOne, saveAll, saveAndFlush
-
-
-
-
Method Detail
-
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.
-
-