-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
getAllPetOwners for specific vet is implemented
- Loading branch information
1 parent
87847fa
commit 60d046c
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/main/java/com/production/ehayvanbackendapi/Repositories/PetOwnerRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
package com.production.ehayvanbackendapi.Repositories; | ||
|
||
import com.production.ehayvanbackendapi.Entities.Pet; | ||
import com.production.ehayvanbackendapi.Entities.PetOwner; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@Repository | ||
public interface PetOwnerRepository extends JpaRepository<PetOwner, Integer> { | ||
@Query(value="SELECT *FROM pet_owner WHERE pet_owner.vetid = :vetid",nativeQuery = true) | ||
public Optional<List<PetOwner>> getAllPetsForPetOwner(@Param("vetid") int vetid); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters