Interface DiagnosisKeyRepository

  • All Superinterfaces:
    org.springframework.data.repository.CrudRepository<DiagnosisKey,​Long>, org.springframework.data.jpa.repository.JpaRepository<DiagnosisKey,​Long>, org.springframework.data.repository.PagingAndSortingRepository<DiagnosisKey,​Long>, org.springframework.data.repository.query.QueryByExampleExecutor<DiagnosisKey>, org.springframework.data.repository.Repository<DiagnosisKey,​Long>

    @Repository
    public interface DiagnosisKeyRepository
    extends org.springframework.data.jpa.repository.JpaRepository<DiagnosisKey,​Long>
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int deleteBySubmissionTimestampIsLessThanEqual​(long submissionTimestamp)
      Deletes all entries that have a submission timestamp lesser or equal to the specified one.
      void saveDoNothingOnConflict​(byte[] keyData, int rollingStartIntervalNumber, int rollingPeriod, long submissionTimestamp, int transmissionRisk)
      Attempts to write the specified diagnosis key information into the database.
      • 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
      • Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

        findAll
      • Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

        count, exists, findAll, findOne
    • Method Detail

      • deleteBySubmissionTimestampIsLessThanEqual

        int deleteBySubmissionTimestampIsLessThanEqual​(long submissionTimestamp)
        Deletes all entries that have a submission timestamp lesser or equal to the specified one.
        Parameters:
        submissionTimestamp - The submission timestamp up to which entries will be deleted.
        Returns:
        The number of rows that were deleted.
      • saveDoNothingOnConflict

        @Modifying
        @Query(nativeQuery=true,
               value="INSERT INTO diagnosis_key(key_data, rolling_start_interval_number, rolling_period, submission_timestamp, transmission_risk_level) VALUES(?, ?, ?, ?, ?) ON CONFLICT DO NOTHING;")
        void saveDoNothingOnConflict​(byte[] keyData,
                                     int rollingStartIntervalNumber,
                                     int rollingPeriod,
                                     long submissionTimestamp,
                                     int transmissionRisk)
        Attempts to write the specified diagnosis key information into the database. If a row with the specified key data already exists, no data is inserted.
        Parameters:
        keyData - The key data of the diagnosis key.
        rollingStartIntervalNumber - The rolling start interval number of the diagnosis key.
        rollingPeriod - The rolling period of the diagnosis key.
        submissionTimestamp - The submission timestamp of the diagnosis key.
        transmissionRisk - The transmission risk level of the diagnosis key.