Skip to content

Commit

Permalink
Merge pull request #95 from UdL-EPS-SoftArch/crud-Favourite
Browse files Browse the repository at this point in the history
crud-favourite
  • Loading branch information
rogargon authored Apr 7, 2024
2 parents d58e8ac + 23617f4 commit 3e84312
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ public class FavouritedPets extends UriEntity<Long> {
@NotNull
Long id;

String userId;
Long petId;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package cat.udl.eps.softarch.demo.repository;

import cat.udl.eps.softarch.demo.domain.FavouritedPets;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface FavouritedPetsRepository extends CrudRepository<FavouritedPets, Long>, PagingAndSortingRepository<FavouritedPets, Long> {
List<FavouritedPets> findByPetId(@Param("petId") Long petId);
List<FavouritedPets> findByUserId(@Param("userId") String userId);
List<FavouritedPets> findByUserIdAndPetId(@Param("userId") String userId,@Param("petId") Long petId);
}

0 comments on commit 3e84312

Please sign in to comment.