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.PagingAndSortingRepository<Rid,CenterAndMachineId>,org.springframework.data.repository.query.QueryByExampleExecutor<Rid>,org.springframework.data.repository.Repository<Rid,CenterAndMachineId>
@Repository public interface RidRepository extends BaseRepository<Rid,CenterAndMachineId>
Repository for RID generation.- Since:
- 1.0.0
- Author:
- Ritesh Sinha
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RidfindRid(String centerId, String machineId)This method fetch entity for provided center and machine id.intupdateRid(int currentSequence, String centerId, String machineId)This method update sequence number against provided center and machine id.-
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
-
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.
-
-