Skip to content

Commit

Permalink
feat: add relation Location Shelter
Browse files Browse the repository at this point in the history
  • Loading branch information
vGerJ02 committed Feb 22, 2024
1 parent c300825 commit 24e9396
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/cat/udl/eps/softarch/demo/domain/Shelter.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,7 @@ public class Shelter extends UriEntity<Long> {
private boolean isActive;

private Integer rating;

@OneToOne
public Location locatedAt;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
import cat.udl.eps.softarch.demo.domain.Shelter;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

import java.util.List;


@RepositoryRestResource
public interface ShelterRepository extends CrudRepository<Shelter, Long>, PagingAndSortingRepository<Shelter, Long> {
List<Shelter> findByLocatedAt(@Param("shelter") Shelter shelter);

}

0 comments on commit 24e9396

Please sign in to comment.