From 73a352973ee0f555a7b15ef6fc232acf207751e1 Mon Sep 17 00:00:00 2001 From: Thomas Cardon Date: Mon, 14 Feb 2022 23:28:20 +0100 Subject: [PATCH] acces aux types par restau --- src/main/java/fr/cardon/simpleat/model/Restaurant.java | 1 - src/main/java/fr/cardon/simpleat/model/TypeRestau.java | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/fr/cardon/simpleat/model/Restaurant.java b/src/main/java/fr/cardon/simpleat/model/Restaurant.java index 0a50a79..7f94abe 100644 --- a/src/main/java/fr/cardon/simpleat/model/Restaurant.java +++ b/src/main/java/fr/cardon/simpleat/model/Restaurant.java @@ -144,7 +144,6 @@ public class Restaurant { @JoinTable(name="type_restau", joinColumns = @JoinColumn(name = "id_restau"/*classe en cours*/,referencedColumnName = "id_restau" /*classe reliƩe*/) , inverseJoinColumns = @JoinColumn(name = "id_type",referencedColumnName = "id_type")) - @JsonBackReference("typerestaus") public Collection getTyperestaus() { return typerestaus; } diff --git a/src/main/java/fr/cardon/simpleat/model/TypeRestau.java b/src/main/java/fr/cardon/simpleat/model/TypeRestau.java index 01f6d51..0d85160 100644 --- a/src/main/java/fr/cardon/simpleat/model/TypeRestau.java +++ b/src/main/java/fr/cardon/simpleat/model/TypeRestau.java @@ -10,6 +10,7 @@ import javax.persistence.Id; import javax.persistence.ManyToMany; import javax.persistence.Table; +import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -49,7 +50,7 @@ public class TypeRestau { } @ManyToMany(mappedBy="typerestaus") - @JsonIgnoreProperties("typerestaus") + @JsonBackReference("restaurants") public List getRestaurants() { return restaurants; }