Package de.dlr.proseo.model.dao
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 TypeMethodDescriptionfindByName(String name) Get list of entries by namefindByNameAndTimeStamp(String name, Instant timestamp) Get list of entries by name and timestampfindLastEntryByName(String name) Get the latest entry by nameGet the latest entry by nameMethods 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
-
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
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
-