From a5b86065d048cbb03b025686f4c935c21ca124e8 Mon Sep 17 00:00:00 2001 From: Israel Date: Sat, 13 Apr 2024 03:16:44 -0600 Subject: [PATCH] * Correccion evitar repetidos --- src/main/java/com/perales/sepomex/model/Ciudad.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/perales/sepomex/model/Ciudad.java b/src/main/java/com/perales/sepomex/model/Ciudad.java index 7dfff63..4154ab8 100644 --- a/src/main/java/com/perales/sepomex/model/Ciudad.java +++ b/src/main/java/com/perales/sepomex/model/Ciudad.java @@ -18,7 +18,7 @@ @Indexed @Data -@EqualsAndHashCode( exclude = { "id", "estado" , "municipios", "colonias", "codigosPostales"}) +@EqualsAndHashCode( exclude = { "id", "estado" , "municipio", "colonias", "codigosPostales"}) @NoArgsConstructor @JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id") @Entity(name = "ciudad") @@ -58,8 +58,7 @@ public class Ciudad implements Serializable { @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "municipio_id") private Municipio municipio; - - + @OneToMany(mappedBy = "ciudad", fetch = FetchType.LAZY) private List codigosPostales; } \ No newline at end of file