Interface RidRepository
- All Superinterfaces:
BaseRepository<Rid,,CenterAndMachineId> org.springframework.data.repository.CrudRepository<Rid,,CenterAndMachineId> org.springframework.data.jpa.repository.JpaRepository<Rid,,CenterAndMachineId> org.springframework.data.repository.ListCrudRepository<Rid,,CenterAndMachineId> org.springframework.data.repository.ListPagingAndSortingRepository<Rid,,CenterAndMachineId> org.springframework.data.repository.PagingAndSortingRepository<Rid,,CenterAndMachineId> org.springframework.data.repository.query.QueryByExampleExecutor<Rid>,org.springframework.data.repository.Repository<Rid,CenterAndMachineId>
Repository for RID generation.
- Since:
- 1.0.0
- Author:
- Ritesh Sinha
-
Method Summary
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
-
findRid
@Query("from Rid r WHERE r.centerId=?1 AND r.machineId=?2") Rid findRid(String centerId, String machineId) This method fetch entity for provided center and machine id.- Parameters:
centerId- the center id.machineId- the machine id.- Returns:
- the entity.
-
updateRid
@Modifying @Transactional @Query("UPDATE Rid r SET r.currentSequenceNo=?1 WHERE r.centerId=?2 AND r.machineId=?3") int updateRid(int currentSequence, String centerId, String machineId) This method update sequence number against provided center and machine id.- Parameters:
currentSequence- the current sequence number.centerId- the center id.machineId- the machine id.- Returns:
- the number of updated rows.
-