diff --git a/src/main/java/cat/udl/eps/softarch/demo/domain/SocialNetworks.java b/src/main/java/cat/udl/eps/softarch/demo/domain/SocialNetworks.java index 73f21077..0247239d 100644 --- a/src/main/java/cat/udl/eps/softarch/demo/domain/SocialNetworks.java +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/SocialNetworks.java @@ -1,9 +1,5 @@ package cat.udl.eps.softarch.demo.domain; - -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; +import jakarta.persistence.*; import lombok.Data; import lombok.EqualsAndHashCode; @@ -13,7 +9,11 @@ public class SocialNetworks extends UriEntity { @Id @GeneratedValue(strategy = GenerationType.AUTO) - Long id; - String instagram; - String twitter; + private Long id; + private String instagram; + private String twitter; + + @ManyToOne + public Shelter belongsTo; + } diff --git a/src/main/java/cat/udl/eps/softarch/demo/repository/SocialNetworksRepository.java b/src/main/java/cat/udl/eps/softarch/demo/repository/SocialNetworksRepository.java new file mode 100644 index 00000000..1eef3cda --- /dev/null +++ b/src/main/java/cat/udl/eps/softarch/demo/repository/SocialNetworksRepository.java @@ -0,0 +1,10 @@ +package cat.udl.eps.softarch.demo.repository; + +import cat.udl.eps.softarch.demo.domain.SocialNetworks; +import org.springframework.data.repository.CrudRepository; +import org.springframework.data.rest.core.annotation.RepositoryRestResource; + +@RepositoryRestResource +public interface SocialNetworksRepository extends CrudRepository { + +}