diff --git a/src/main/java/cat/udl/eps/softarch/demo/domain/Location.java b/src/main/java/cat/udl/eps/softarch/demo/domain/Location.java index 4623fc2..d515f78 100644 --- a/src/main/java/cat/udl/eps/softarch/demo/domain/Location.java +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/Location.java @@ -12,6 +12,10 @@ @Entity @EqualsAndHashCode(callSuper = false) public class Location { + @OneToOne + @NotNull + @JsonIdentityReference(alwaysAsId = true) + private Shelter shelter; @Id @GeneratedValue(strategy = GenerationType.AUTO) diff --git a/src/main/java/cat/udl/eps/softarch/demo/repository/LocationRepository.java b/src/main/java/cat/udl/eps/softarch/demo/repository/LocationRepository.java new file mode 100644 index 0000000..ea42215 --- /dev/null +++ b/src/main/java/cat/udl/eps/softarch/demo/repository/LocationRepository.java @@ -0,0 +1,11 @@ +package cat.udl.eps.softarch.demo.repository; + +import cat.udl.eps.softarch.demo.domain.Location; +import cat.udl.eps.softarch.demo.domain.User; +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.repository.PagingAndSortingRepository; + +public interface LocationRepository extends CrudRepository, PagingAndSortingRepository { + + +}