diff --git a/pom.xml b/pom.xml index e697f511..08237926 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 @@ -245,6 +249,11 @@ + + org.wildfly.plugins + wildfly-maven-plugin + 1.2.1.Final + @@ -336,4 +345,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; }