Interface ConsultationRepository
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<Consultation,,Long> org.springframework.data.jpa.repository.JpaRepository<Consultation,,Long> org.springframework.data.repository.ListCrudRepository<Consultation,,Long> org.springframework.data.repository.ListPagingAndSortingRepository<Consultation,,Long> org.springframework.data.repository.PagingAndSortingRepository<Consultation,,Long> org.springframework.data.repository.query.QueryByExampleExecutor<Consultation>,org.springframework.data.repository.Repository<Consultation,Long>
public interface ConsultationRepository
extends org.springframework.data.jpa.repository.JpaRepository<Consultation,Long>
Repository interface for retrieving and manipulating all Consultation objects using their unique Long identifier.
- Version:
- 1.0
- Author:
- Mirna Gama
-
Method Summary
Modifier and TypeMethodDescriptionfindConsultationByDoctorAndDate(Long doctorId, LocalDateTime consultationDate) findConsultationByPatientAndDate(Long patientId, LocalDateTime consultationDate) Methods 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
-
findConsultationByPatientAndDate
@Query("select c from Consultation c\nwhere c.patient.id = :patientId\nand c.consultationDate = :consultationDate\n") Consultation findConsultationByPatientAndDate(Long patientId, LocalDateTime consultationDate) - Parameters:
patientId- The patient's id from the consultationconsultationDate- The date of the consultation- Returns:
- The corresponding consultation if successful, or null if it is non-existent
-
findConsultationByDoctorAndDate
@Query("select c from Consultation c\nwhere c.doctor.id = :doctorId\nand c.consultationDate = :consultationDate\n") Consultation findConsultationByDoctorAndDate(Long doctorId, LocalDateTime consultationDate) - Parameters:
doctorId- The doctor's id from the consultationconsultationDate- The date of the consultation- Returns:
- The corresponding consultation if successful, or null if it is non-existent
-