diff --git a/.gitignore b/.gitignore index c2065bc..1acaf36 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,5 @@ out/ ### VS Code ### .vscode/ + +application.properties diff --git a/src/main/java/fr/cardon/simpleat/controller/PreferenceController.java b/src/main/java/fr/cardon/simpleat/controller/PreferenceController.java index 3bbe8d3..b1659e7 100644 --- a/src/main/java/fr/cardon/simpleat/controller/PreferenceController.java +++ b/src/main/java/fr/cardon/simpleat/controller/PreferenceController.java @@ -65,16 +65,4 @@ public class PreferenceController { PreferencePK id = new PreferencePK(personneRepository.getById(iduser) ,restaurantRepository.getById(idrestau)); preferenceRepository.deleteById(id); } - -// @DeleteMapping("/delete-pref-byrestau/{idrestau}") -// public void deletePreferenceByRestau(@PathVariable int idrestau ){ -// List list = personneRepository.findAll(); -// for (int i = 0; i < list.size(); i++) { -// if(findPreferenceById(list.get(i).getId(),idrestau).isEmpty() == false) { -// preferenceRepository.deleteById(new PreferencePK(list.get(i),new Restaurant(idrestau))); -// } -// //System.out.println(findPreferenceById(list.get(i).getId(),idrestau).isEmpty()); -// } -// -// } } diff --git a/src/main/java/fr/cardon/simpleat/model/Personne.java b/src/main/java/fr/cardon/simpleat/model/Personne.java index 121f2a3..520f149 100644 --- a/src/main/java/fr/cardon/simpleat/model/Personne.java +++ b/src/main/java/fr/cardon/simpleat/model/Personne.java @@ -116,16 +116,19 @@ public class Personne { public void setRoles(Collection roles) { this.roles = roles; } + - @OneToMany(mappedBy = "personne", cascade = CascadeType.REMOVE) + @OneToMany(mappedBy = "preferencePK.personne", cascade = CascadeType.REMOVE) @JsonIgnore public Collection getPreference() { return preference; } + public void setPreference(Collection preference) { this.preference = preference; } + diff --git a/src/main/java/fr/cardon/simpleat/model/PreferencePK.java b/src/main/java/fr/cardon/simpleat/model/PreferencePK.java index 567f698..2cd7550 100644 --- a/src/main/java/fr/cardon/simpleat/model/PreferencePK.java +++ b/src/main/java/fr/cardon/simpleat/model/PreferencePK.java @@ -4,6 +4,12 @@ package fr.cardon.simpleat.model; import java.io.Serializable; import javax.persistence.Embeddable; +import javax.persistence.FetchType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.PrimaryKeyJoinColumn; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -30,6 +36,9 @@ public class PreferencePK implements Serializable { } + @ManyToOne + @PrimaryKeyJoinColumn(name="id_personne", referencedColumnName ="id_personne" ) + @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) public Personne getPersonne() { return personne; } @@ -39,6 +48,9 @@ public class PreferencePK implements Serializable { this.personne = personne; } + @ManyToOne // TODO mappedBy preferences dans restaurant + @PrimaryKeyJoinColumn(name="id_restau",referencedColumnName ="id_restau" ) + @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) public Restaurant getRestau() { return restau; } diff --git a/src/main/java/fr/cardon/simpleat/model/Restaurant.java b/src/main/java/fr/cardon/simpleat/model/Restaurant.java index 7309600..ee69cc4 100644 --- a/src/main/java/fr/cardon/simpleat/model/Restaurant.java +++ b/src/main/java/fr/cardon/simpleat/model/Restaurant.java @@ -24,36 +24,22 @@ public class Restaurant { private String nom; private String adresse; private String telephone; - private boolean aEmporter; - private boolean surPlace; - private int prix; - private boolean accesPMR; + private Boolean aEmporter; + private Boolean surPlace; + private Integer prix; + private Boolean accesPMR; private String latitude; private String longitude; private String website; private Collection typerestaus = new ArrayList(); private Collection preference = new ArrayList(); - - //TODO @OneToMany relier avec une collec de preferences - public Restaurant() { super(); // TODO Auto-generated constructor stub } - - - - public Restaurant(int id) { - super(); - this.id = id; - } - - - - - public Restaurant(String nom, String adresse, String telephone, boolean aEmporter, boolean surPlace, int prix, - boolean accesPMR, String latitude, String longitude, String website, Collection typerestaus) { + public Restaurant(String nom, String adresse, String telephone, Boolean aEmporter, Boolean surPlace, int prix, + Boolean accesPMR, String latitude, String longitude, String website, Collection typerestaus) { super(); this.nom = nom; this.adresse = adresse; @@ -101,31 +87,31 @@ public class Restaurant { this.telephone = telephone; } @Column(nullable = true) - public boolean isaEmporter() { + public Boolean isaEmporter() { return aEmporter; } - public void setaEmporter(boolean aEmporter) { + public void setaEmporter(Boolean aEmporter) { this.aEmporter = aEmporter; } @Column(nullable = true) - public boolean isSurPlace() { + public Boolean isSurPlace() { return surPlace; } - public void setSurPlace(boolean surPlace) { + public void setSurPlace(Boolean surPlace) { this.surPlace = surPlace; } @Column(nullable = true) - public int getPrix() { + public Integer getPrix() { return prix; } - public void setPrix(int prix) { + public void setPrix(Integer prix) { this.prix = prix; } @Column(nullable = true) - public boolean isAccesPMR() { + public Boolean isAccesPMR() { return accesPMR; } - public void setAccesPMR(boolean accesPMR) { + public void setAccesPMR(Boolean accesPMR) { this.accesPMR = accesPMR; } @Column(nullable = false) @@ -154,7 +140,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")) - @JsonIgnore public Collection getTyperestaus() { return typerestaus; } @@ -162,8 +147,8 @@ public class Restaurant { public void setTyperestaus(Collection typerestaus) { this.typerestaus = typerestaus; } - - @OneToMany(mappedBy = "restau", cascade = CascadeType.REMOVE) + + @OneToMany(mappedBy = "preferencePK.restau", cascade = CascadeType.REMOVE) @JsonIgnore public Collection getPreference() { return preference; @@ -173,7 +158,4 @@ public class Restaurant { public void setPreference(Collection preference) { this.preference = preference; } - - - } diff --git a/src/main/java/fr/cardon/simpleat/model/TypeRestau.java b/src/main/java/fr/cardon/simpleat/model/TypeRestau.java index 37beaeb..eea110f 100644 --- a/src/main/java/fr/cardon/simpleat/model/TypeRestau.java +++ b/src/main/java/fr/cardon/simpleat/model/TypeRestau.java @@ -10,8 +10,7 @@ import javax.persistence.Id; import javax.persistence.ManyToMany; import javax.persistence.Table; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonBackReference; @Entity @@ -50,7 +49,7 @@ public class TypeRestau { } @ManyToMany(mappedBy="typerestaus") - @JsonIgnoreProperties("typerestaus") + @JsonBackReference("restaurants") public List getRestaurants() { return restaurants; } diff --git a/src/main/resources/Postman b/src/main/resources/Postman index 94de556..cbee787 100644 --- a/src/main/resources/Postman +++ b/src/main/resources/Postman @@ -169,15 +169,19 @@ } }, "url": { - "raw": "localhost:8080/preference/5/5", + + "raw": "localhost:8080/preference/1/3", + "host": [ "localhost" ], "port": "8080", "path": [ "preference", - "5", - "5" + + "1", + "3" + ] } }, @@ -208,7 +212,9 @@ "header": [], "body": { "mode": "raw", - "raw": "{\r\n \"preferencePK\": {\r\n \"personne\": {\r\n \"id\": 10\r\n },\r\n \"restau\": {\r\n \"id\": 2\r\n }\r\n },\r\n \"note\": 5,\r\n \"favori\": true\r\n}", + + "raw": "{\r\n \"personne\": {\r\n \"id\": 1\r\n },\r\n \"restau\": {\r\n \"id\": 5\r\n },\r\n \"note\": 5,\r\n \"favoris\": true\r\n}", + "options": { "raw": { "language": "json" diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql index 8aa3c00..6615fc2 100644 --- a/src/main/resources/data.sql +++ b/src/main/resources/data.sql @@ -13,26 +13,66 @@ insert into personne (nom, prenom, email, password) values ('Crick', 'Andris', ' insert into role (id_role, intitule) values (1, 'Admin'); insert into role (id_role, intitule) values (2, 'User'); -insert into restaurant (nom, adresse, telephone, a_emporter, sur_place, prix, accespmr, latitude, longitude) values ('L Perrigo Company', '301 Thierer Trail', '3092096786', false, true, 1, false, '2.1961772', '22.4708685'); -insert into restaurant (nom, adresse, telephone, a_emporter, sur_place, prix, accespmr, latitude, longitude) values ('Sanofi Pasteur Inc.', '9 Barnett Terrace', '6809964349', false, true, 2, false, '31.45571', '34.43719'); -insert into restaurant (nom, adresse, telephone, a_emporter, sur_place, prix, accespmr, latitude, longitude) values ('REMEDYREPACK INC.', '3 West Park', '4565542193', true, false, 3, true, '49.817777', '19.785536'); -insert into restaurant (nom, adresse, telephone, a_emporter, sur_place, prix, accespmr, latitude, longitude) values ('Physicians Total Care, Inc.', '462 Mosinee Lane', '8521719889', false, false, 4, true, '-13.5', '48.86667'); -insert into restaurant (nom, adresse, telephone, a_emporter, sur_place, prix, accespmr, latitude, longitude) values ('Triweld Industries, Inc.', '2482 Corscot Way', '7513208452', false, true, 2, true, '34.326903', '108.117456'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,0,1,1,'Le Jardin de Montreuil','1 Rue du Sergent Godefroy, 93100 Montreuil','01 41 63 92 66','http://www.lejardindemontreuil.fr/','48.853391599999995','2.4347358'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,0,'La CaVe','45 Rue de Paris, 93100 Montreuil','01 42 87 09 48','http://www.lacaveestrestaurant.com/','48.8576152','2.4342148999999997'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (3,0,1,1,'Villa 9 Trois','71 Rue Hoche, 93100 Montreuil','01 48 58 17 37','http://www.villa9trois.com/','48.8638352','2.4331966'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,1,'L''Amourette','54 Rue Robespierre, 93100 Montreuil','01 48 59 99 94','http://www.lamourette.fr/','48.853121599999994','2.4234494'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,1,'La Maison Montreuil','31 Rue du Capitaine Dreyfus, 93100 Montreuil','09 87 18 18 81','https://www.lamaisonmontreuil.com/','48.859359700000006','2.4399254999999997'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (1,1,1,1,'le poulet en feu','63 Rue Danton, 93100 Montreuil','09 87 51 10 90','https://www.pouletenfeu.fr/','48.8653553','2.4514297'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,0,1,1,'Les Tonneaux','62 Rue Robespierre, 93100 Montreuil','01 48 58 95 01',NULL,'48.85205','2.4238472'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,1,'Les Pianos','26 Rue Robespierre, 93100 Montreuil','09 63 53 85 17','https://www.facebook.com/lespianosmontreuilofficiel/','48.854841799999996','2.4230319'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,0,1,1,'M I M','113 Rue Marceau, 93100 Montreuil','01 43 63 31 13',NULL,'48.849849999999996','2.4265312999999997'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (1,1,1,1,'Le Gévaudan','1 Bd Rouget de Lisle, 93100 Montreuil','01 42 87 42 83',NULL,'48.8617445','2.4412374'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,1,'Restaurant Filippo','6 Bd Chanzy, 93100 Montreuil','01 48 18 08 16',NULL,'48.8583964','2.4349743'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (1,0,1,1,'Le Mange Disc','50 Rue de Romainville, 93100 Montreuil','09 83 54 60 27','https://m.facebook.com/Le-Mange-Disc-102557926519195/?locale2=fr_FR','48.8658457','2.4466363'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (1,1,1,NULL,'Restaurant El Kahina','227 Rue de Paris, 93100 Montreuil','01 48 70 95 46',NULL,'48.8550124','2.4195686'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (NULL,1,1,1,'La Baraka','262 Rue de Paris, 93100 Montreuil','01 42 87 19 27','http://www.labarakamontreuil.fr/?lang=fr','48.8549268','2.4177603999999997'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,1,'La Bottega Della Pizza','34 Bd Rouget de Lisle, 93100 Montreuil','01 43 63 04 35','http://www.labottegadellapizza.fr/','48.860204200000005','2.4387626'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,0,1,NULL,'Restaurant de la Paix','11 Rue Armand Carrel, 93100 Montreuil','01 73 55 21 72',NULL,'48.853764','2.4177003999999997'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,1,'La Fontaine Bar Restaurant','47 Rue Armand Carrel, 93100 Montreuil','01 48 70 08 84','https://www.facebook.com/pages/la-fontaine-de-montreuil-Restaurant/213852528659590?fref=ts','48.8512132','2.4183881'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (3,1,1,NULL,'La Cantine Arkose Montreuil','33 Rue du Progrès, 93100 Montreuil','01 49 88 45 07','https://lacantine.arkose.com/montreuil/','48.8516335','2.419278'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (3,1,1,NULL,'Kashmir Café.','14 Rue du Capitaine Dreyfus, 93100 Montreuil','01 43 63 33 86','http://www.kashmircafe.fr/','48.8582843','2.4378471999999998'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,1,'W Lounge','37 Rue de Valmy, 93100 Montreuil','01 48 37 61 17','http://wlounge-montreuil.com/?utm_source=gmb&utm_medium=referral','48.8507208','2.4187186'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (1,1,1,1,'L''Oasis','171 Rue de Paris, 93100 Montreuil','01 48 70 70 52','https://loasis-montreuil.fr/fr','48.855555599999995','2.4230556'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,1,'Obrigado','8 Av. de la Prte de Montreuil, 75020 Paris','09 84 58 24 21','http://obrigado.paris/','48.8534995','2.4118692'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,1,'Le Xanthos','30 Rue du Capitaine Dreyfus, 93100 Montreuil','01 55 86 26 77',NULL,'48.858785','2.4388468999999997'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,1,'Thé Vert','43 Rue du Capitaine Dreyfus, 93100 Montreuil','01 42 87 79 57','http://www.thevertenligne.fr/','48.8596741','2.4405049'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,1,'Gramophone','1 Rue Pépin, 93100 Montreuil','01 49 88 74 56','http://www.restaurantlegramophone.com/','48.8641275','2.4449753'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,0,1,NULL,'La Grosse Mignonne','56 Rue Carnot, 93100 Montreuil','01 42 87 54 51','https://www.facebook.com/LaGrosseMignonne','48.855322','2.4413144'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (1,1,1,NULL,'La Galetiere','126 Rue de Paris, 93100 Montreuil','01 42 87 47 32','http://lagaletiere.eatbu.com/','48.8563999','2.4263293'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (3,1,1,1,'Le Mamaju','36 Rue de Lagny, 93100 Montreuil','01 83 74 02 26','https://mamaju-restaurant-montreuil.eatbu.com/','48.8490247','2.4265491'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,NULL,'Le Pizzo','15 Rue du Capitaine Dreyfus, 93100 Montreuil','09 88 46 71 29',NULL,'48.8588721','2.4385882999999997'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,NULL,'L''Olivier','211 Rue de Paris, 93100 Montreuil','06 47 82 43 41',NULL,'48.855081','2.4203481'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,1,'Louise','27 Rue du Capitaine Dreyfus, 93100 Montreuil','06 75 32 56 81','https://instagram.com/cafelouisemontreuil?utm_medium=copy_link','48.859237','2.4394462'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (1,1,1,1,'Ô Bar Lié','16 Rue de la République, 93100 Montreuil','01 48 58 71 95','http://www.obarlie.com/','48.8531155','2.4209562'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (1,1,1,NULL,'Gabycook','27 Rue du Progrès, 93100 Montreuil',NULL,NULL,'48.851772999999994','2.4202114'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,1,'L''ALEMBERT','268 Rue de Paris, 93100 Montreuil','01 42 87 29 61','http://www.lalembert.fr/','48.8549126','2.4174881999999998'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,NULL,'Gujarat','35 Bd Paul Vaillant Couturier, 93100 Montreuil','01 48 58 77 16','http://restaurantgujarat.fr/','48.865111','2.443053'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,NULL,'L''effiloché Montreuil','5 Rue du Centenaire, 93100 Montreuil',NULL,NULL,'48.8579636','2.4270348'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,NULL,'Famille-CMC','6 Av. Pasteur, 93100 Montreuil',NULL,NULL,'48.862999300000006','2.441328'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,NULL,'O''Villagio','28 Rue du Capitaine Dreyfus, 93100 Montreuil','01 57 42 63 82','https://ovillaggio93.wixsite.com/o-villaggio','48.858722','2.4386695'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,1,'La Brasserie des Laitières','38 Rue de Lagny, 93100 Montreuil','01 48 51 50 70','https://le-bl.metro.biz/','48.8490399','2.4262376999999997'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (1,1,1,1,'LE HAVANE','248 Rue de Paris, 93100 Montreuil','01 48 57 17 23',NULL,'48.855091599999994','2.4187965'); +INSERT INTO restaurant(prix,a_emporter,sur_place,accespmr,nom,adresse,telephone,website,latitude,longitude) VALUES (2,1,1,1,'Chez Carla','6 Rue Claude Bernard, 93100 Montreuil','01 48 18 00 53','http://www.chezcarla.fr/','48.8699343','2.4507599'); + + + + +insert into preference (restau_id_restau, personne_id_personne, note, favori) values (2, 9, 1, false); +insert into preference (restau_id_restau, personne_id_personne, note, favori) values (3, 1, 5, false); +insert into preference (restau_id_restau, personne_id_personne, note, favori) values (1, 9, 3, true); +insert into preference (restau_id_restau, personne_id_personne, note, favori) values (4, 6, 2, false); +insert into preference (restau_id_restau, personne_id_personne, note, favori) values (5, 5, 5, false); +insert into preference (restau_id_restau, personne_id_personne, note, favori) values (1, 10, 1, false); +insert into preference (restau_id_restau, personne_id_personne, note, favori) values (5, 3, 5, false); +insert into preference (restau_id_restau, personne_id_personne, note, favori) values (1, 7, 1, true); +insert into preference (restau_id_restau, personne_id_personne, note, favori) values (4, 2, 1, false); +insert into preference (restau_id_restau, personne_id_personne, note, favori) values (1, 3, 5, false); +insert into preference (restau_id_restau, personne_id_personne, note, favori) values (3, 10, 4, false); +insert into preference (restau_id_restau, personne_id_personne, note, favori) values (3, 3, 4, true); +insert into preference (restau_id_restau, personne_id_personne, note, favori) values (2, 3, 3, false); +insert into preference (restau_id_restau, personne_id_personne, note, favori) values (2, 8, 3, false); -insert into preference (id_restau, id_personne, note, favoris) values (2, 9, 1, false); -insert into preference (id_restau, id_personne, note, favoris) values (3, 1, 5, false); -insert into preference (id_restau, id_personne, note, favoris) values (1, 9, 3, true); -insert into preference (id_restau, id_personne, note, favoris) values (4, 6, 2, false); -insert into preference (id_restau, id_personne, note, favoris) values (5, 5, 5, false); -insert into preference (id_restau, id_personne, note, favoris) values (1, 10, 1, false); -insert into preference (id_restau, id_personne, note, favoris) values (5, 3, 5, false); -insert into preference (id_restau, id_personne, note, favoris) values (1, 7, 1, true); -insert into preference (id_restau, id_personne, note, favoris) values (4, 2, 1, false); -insert into preference (id_restau, id_personne, note, favoris) values (1, 3, 5, false); -insert into preference (id_restau, id_personne, note, favoris) values (3, 10, 4, false); -insert into preference (id_restau, id_personne, note, favoris) values (3, 3, 4, true); -insert into preference (id_restau, id_personne, note, favoris) values (2, 3, 3, false); -insert into preference (id_restau, id_personne, note, favoris) values (2, 8, 3, false); insert into type (id_type, libelle) values (1, 'Kebab'); insert into type (id_type, libelle) values (2, 'Supermarché');