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 public interface RidRepository extends BaseRepository<Rid,CenterAndMachineId>
Repository for RID generation.
Since:
1.0.0
Author:
Ritesh Sinha
  • Method Summary

    Modifier and Type
    Method
    Description
    findRid(String centerId, String machineId)
    This method fetch entity for provided center and machine id.
    int
    updateRid(int currentSequence, String centerId, String machineId)
    This method update sequence number against provided center and machine id.

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods 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.