package org.jhipster.health.repository; import org.jhipster.health.domain.BloodPressure; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import java.time.ZonedDateTime; import java.util.List; /** * Spring Data JPA repository for the BloodPressure entity. */ @SuppressWarnings("unused") public interface BloodPressureRepository extends JpaRepository<BloodPressure,Long> { @Query("select bloodPressure from BloodPressure bloodPressure where bloodPressure.user.login = ?#{principal.username} order by bloodPressure.timestamp desc") Page<BloodPressure> findByUserIsCurrentUser(Pageable pageable); Page<BloodPressure> findAllByOrderByTimestampDesc(Pageable pageable); List<BloodPressure> findAllByTimestampBetweenOrderByTimestampDesc(ZonedDateTime firstDate, ZonedDateTime secondDate); List<BloodPressure> findAllByTimestampBetweenAndUserLoginOrderByTimestampDesc(ZonedDateTime firstDate, ZonedDateTime secondDate, String login); }