source: backend/src/main/java/com/finki/icare/repository/ConsultationRepository.java

main
Last change on this file was 700e2f9, checked in by 186079 <matej.milevski@…>, 5 days ago

Init

  • Property mode set to 100644
File size: 798 bytes
Line 
1package com.finki.icare.repository;
2
3import com.finki.icare.model.Consultation;
4import org.springframework.data.jpa.repository.JpaRepository;
5import org.springframework.data.jpa.repository.Query;
6import org.springframework.data.repository.query.Param;
7import org.springframework.stereotype.Repository;
8
9import java.util.List;
10
11@Repository
12public interface ConsultationRepository extends JpaRepository<Consultation, Integer> {
13
14 @Query("SELECT c FROM Consultation c WHERE c.therapist.idUser = :therapistId ORDER BY c.date DESC")
15 List<Consultation> findByTherapistId(@Param("therapistId") Integer therapistId);
16
17 @Query("SELECT c FROM Consultation c WHERE c.patient.idUser = :patientId ORDER BY c.date DESC")
18 List<Consultation> findByPatientId(@Param("patientId") Integer patientId);
19}
Note: See TracBrowser for help on using the repository browser.