diff --git a/src/main/java/cat/udl/eps/softarch/demo/domain/Shelter.java b/src/main/java/cat/udl/eps/softarch/demo/domain/Shelter.java index b6673c73..7fdaaf46 100644 --- a/src/main/java/cat/udl/eps/softarch/demo/domain/Shelter.java +++ b/src/main/java/cat/udl/eps/softarch/demo/domain/Shelter.java @@ -24,6 +24,7 @@ public class Shelter extends UriEntity { private Long id; @NotBlank + @Column(unique = true) private String name; @NotBlank @@ -36,10 +37,12 @@ public class Shelter extends UriEntity { private String mobile; @PastOrPresent + @GeneratedValue(strategy = GenerationType.AUTO) @NotNull private ZonedDateTime createdAt; @PastOrPresent + @GeneratedValue(strategy = GenerationType.AUTO) private ZonedDateTime updatedAt; @NotNull diff --git a/src/main/java/cat/udl/eps/softarch/demo/repository/ShelterRepository.java b/src/main/java/cat/udl/eps/softarch/demo/repository/ShelterRepository.java index 556b18b0..631219ae 100644 --- a/src/main/java/cat/udl/eps/softarch/demo/repository/ShelterRepository.java +++ b/src/main/java/cat/udl/eps/softarch/demo/repository/ShelterRepository.java @@ -12,6 +12,5 @@ @RepositoryRestResource public interface ShelterRepository extends CrudRepository, PagingAndSortingRepository { - List findByLocatedAt(@Param("location") Location locatedAt); - + List findByName(@Param("name") String name); } \ No newline at end of file