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 Type
    Method
    Description
    findConsultationByDoctorAndDate(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, 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

    • 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 consultation
      consultationDate - 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 consultation
      consultationDate - The date of the consultation
      Returns:
      The corresponding consultation if successful, or null if it is non-existent