From e29f01aa38360f0dec1cc88d293554123ae16376 Mon Sep 17 00:00:00 2001 From: Greg Steel Date: Mon, 15 Jan 2018 14:52:59 +1100 Subject: [PATCH 1/3] fixes --- pom.xml | 36 +++++++++++-------- .../application/petstore/model/Address.java | 2 +- .../application/petstore/model/Item.java | 2 +- .../petstore/service/CustomerService.java | 2 -- 4 files changed, 24 insertions(+), 18 deletions(-) mode change 100644 => 100755 src/main/java/org/agoncal/application/petstore/model/Address.java diff --git a/pom.xml b/pom.xml index e697f511..691fae17 100755 --- a/pom.xml +++ b/pom.xml @@ -209,8 +209,12 @@ false - org.agoncal.application.petstore.rest - http,https + + org.agoncal.application.petstore.rest + + + http,https + localhost:8080 /applicationPetstore/rest json @@ -243,8 +247,23 @@ swagger-hibernate-validations ${version.swagger} + + com.sun.xml.bind + jaxb-impl + 2.2.11 + + + com.sun.xml.bind + jaxb-core + 2.2.11 + + + org.wildfly.plugins + wildfly-maven-plugin + 1.2.1.Final + @@ -304,17 +323,6 @@ - - org.apache.maven.plugins - maven-surefire-plugin - ${version.maven.surefire.plugin} - - false - - arquillian-wildfly-managed - - - @@ -336,4 +344,4 @@ - \ No newline at end of file + diff --git a/src/main/java/org/agoncal/application/petstore/model/Address.java b/src/main/java/org/agoncal/application/petstore/model/Address.java old mode 100644 new mode 100755 index 69956db1..99e094f5 --- a/src/main/java/org/agoncal/application/petstore/model/Address.java +++ b/src/main/java/org/agoncal/application/petstore/model/Address.java @@ -43,7 +43,7 @@ public class Address implements Serializable @NotNull private String zipcode; - @ManyToOne(cascade = CascadeType.PERSIST) + @ManyToOne private Country country = new Country(); // ====================================== diff --git a/src/main/java/org/agoncal/application/petstore/model/Item.java b/src/main/java/org/agoncal/application/petstore/model/Item.java index 18e069c8..c2593e5b 100644 --- a/src/main/java/org/agoncal/application/petstore/model/Item.java +++ b/src/main/java/org/agoncal/application/petstore/model/Item.java @@ -58,7 +58,7 @@ public class Item implements Serializable @Price private Float unitCost; - @ManyToOne(cascade = CascadeType.PERSIST) + @ManyToOne @JoinColumn(name = "product_fk", nullable = false) @XmlTransient private Product product; diff --git a/src/main/java/org/agoncal/application/petstore/service/CustomerService.java b/src/main/java/org/agoncal/application/petstore/service/CustomerService.java index bff7dc31..539a1518 100755 --- a/src/main/java/org/agoncal/application/petstore/service/CustomerService.java +++ b/src/main/java/org/agoncal/application/petstore/service/CustomerService.java @@ -65,8 +65,6 @@ public boolean doesLoginAlreadyExist(@NotNull String login) public Customer createCustomer(@NotNull Customer customer) { - Country country = entityManager.find(Country.class, customer.getHomeAddress().getCountry().getId()); - customer.getHomeAddress().setCountry(country); entityManager.persist(customer); return customer; } From aac1dfbd31a729e47c281a4e24813928314458ae Mon Sep 17 00:00:00 2001 From: Greg Steel Date: Mon, 15 Jan 2018 14:55:13 +1100 Subject: [PATCH 2/3] tidy --- pom.xml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/pom.xml b/pom.xml index 691fae17..0c0b9ac2 100755 --- a/pom.xml +++ b/pom.xml @@ -247,16 +247,6 @@ swagger-hibernate-validations ${version.swagger} - - com.sun.xml.bind - jaxb-impl - 2.2.11 - - - com.sun.xml.bind - jaxb-core - 2.2.11 - From ece68b9e8cb8ec7e62b63d36041853f8041691d1 Mon Sep 17 00:00:00 2001 From: Greg Steel Date: Mon, 15 Jan 2018 14:58:16 +1100 Subject: [PATCH 3/3] replace surefire --- pom.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pom.xml b/pom.xml index 0c0b9ac2..08237926 100755 --- a/pom.xml +++ b/pom.xml @@ -313,6 +313,17 @@ + + org.apache.maven.plugins + maven-surefire-plugin + ${version.maven.surefire.plugin} + + false + + arquillian-wildfly-managed + + +