Interface ApiMetricsRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<ApiMetrics,Long>, org.springframework.data.jpa.repository.JpaRepository<ApiMetrics,Long>, org.springframework.data.repository.ListCrudRepository<ApiMetrics,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<ApiMetrics,Long>, org.springframework.data.repository.PagingAndSortingRepository<ApiMetrics,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<ApiMetrics>, org.springframework.data.repository.Repository<ApiMetrics,Long>

public interface ApiMetricsRepository extends org.springframework.data.jpa.repository.JpaRepository<ApiMetrics,Long>
Data Access Object for the ApiMetrics class
Author:
Ernst Melchinger
  • Method Summary

    Modifier and Type
    Method
    Description
    Get list of entries by name
    Get list of entries by name and timestamp
    Get the latest entry by name
    Get the latest entry by name

    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

    • findLastTimeStampByName

      @Query("select max(d.timestamp) from ApiMetrics d where name = ?1") Instant findLastTimeStampByName(String name)
      Get the latest entry by name
      Returns:
      the latest entry by name
    • findLastEntryByName

      @Query("select d from ApiMetrics d where name = ?1 and timestamp = (select max(d.timestamp) from ApiMetrics d where name = ?1)") ApiMetrics findLastEntryByName(String name)
      Get the latest entry by name
      Returns:
      the latest entry by name
    • findByName

      @Query("select d from ApiMetrics d where name = ?1") List<ApiMetrics> findByName(String name)
      Get list of entries by name
      Returns:
      the list of entries by name
    • findByNameAndTimeStamp

      @Query("select d from ApiMetrics d where name = ?1 and timestamp = ?2") List<ApiMetrics> findByNameAndTimeStamp(String name, Instant timestamp)
      Get list of entries by name and timestamp
      Returns:
      the list of entries by name and timestamp