source: src/main/java/com/example/medweb/repository/UpatRepository.java

Last change on this file was e5fefbd, checked in by Anita Terziska <63020646+Nit4e@…>, 2 years ago

initial commit

  • Property mode set to 100644
File size: 584 bytes
Line 
1package com.example.medweb.repository;
2
3import com.example.medweb.model.Pacient;
4import com.example.medweb.model.Upat;
5import org.springframework.data.jpa.repository.JpaRepository;
6import org.springframework.data.jpa.repository.Query;
7import org.springframework.stereotype.Repository;
8
9import java.util.List;
10import java.util.Optional;
11
12
13@Repository
14public interface UpatRepository extends JpaRepository<Upat, Integer> {
15
16 Optional<Upat> findById(Integer upat_id);
17
18 @Query("select u from Upat u where u.pacient = :pacient")
19 List<Upat> findAllByPacient (Pacient pacient);
20}
Note: See TracBrowser for help on using the repository browser.