Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #12

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,12 @@
<apiSources>
<apiSource>
<springmvc>false</springmvc>
<locations>org.agoncal.application.petstore.rest</locations>
<schemes>http,https</schemes>
<locations>
<location>org.agoncal.application.petstore.rest</location>
</locations>
<schemes>
<scheme>http,https</scheme>
</schemes>
<host>localhost:8080</host>
<basePath>/applicationPetstore/rest</basePath>
<outputFormats>json</outputFormats>
Expand Down Expand Up @@ -245,6 +249,11 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.2.1.Final</version>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -336,4 +345,4 @@
</repository>
</repositories>

</project>
</project>
2 changes: 1 addition & 1 deletion src/main/java/org/agoncal/application/petstore/model/Address.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class Address implements Serializable
@NotNull
private String zipcode;

@ManyToOne(cascade = CascadeType.PERSIST)
@ManyToOne
private Country country = new Country();

// ======================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down