-
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.
get all pets for specific pet owner operation is implemented
- Loading branch information
1 parent
16ca7a6
commit 87847fa
Showing
3 changed files
with
35 additions
and
11 deletions.
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
8 changes: 8 additions & 0 deletions
8
src/main/java/com/production/ehayvanbackendapi/Repositories/PetRepository.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,17 @@ | ||
package com.production.ehayvanbackendapi.Repositories; | ||
|
||
import com.production.ehayvanbackendapi.Entities.Appointment; | ||
import com.production.ehayvanbackendapi.Entities.Pet; | ||
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 PetRepository extends JpaRepository<Pet, Integer> { | ||
@Query(value="SELECT *FROM Pet WHERE Pet.pet_ownerid = :pet_ownerid",nativeQuery = true) | ||
public Optional<List<Pet>> getAllPetsForPetOwner(@Param("pet_ownerid") int pet_ownerid); | ||
} |
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