diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2013-08-10 18:28:36 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2013-08-10 18:28:36 +0200 |
commit | 46cb0cef9303940ade51ffe16831f55ee9cd8e1f (patch) | |
tree | a89a3538ff0d3fd56b6d401cd296940b2336657d /myapp/src/main/java/io | |
parent | 5a1256a8ed931f7a5ba05c4328353411bae31f2b (diff) | |
download | container-playground-46cb0cef9303940ade51ffe16831f55ee9cd8e1f.tar.gz container-playground-46cb0cef9303940ade51ffe16831f55ee9cd8e1f.tar.bz2 container-playground-46cb0cef9303940ade51ffe16831f55ee9cd8e1f.tar.xz container-playground-46cb0cef9303940ade51ffe16831f55ee9cd8e1f.zip |
o Start of loading referenced (singular) entities.
Diffstat (limited to 'myapp/src/main/java/io')
3 files changed, 6 insertions, 11 deletions
diff --git a/myapp/src/main/java/io/trygvis/container/myapp/AddressBookDirect.java b/myapp/src/main/java/io/trygvis/container/myapp/AddressBookDirect.java index 86e8641..b272649 100644 --- a/myapp/src/main/java/io/trygvis/container/myapp/AddressBookDirect.java +++ b/myapp/src/main/java/io/trygvis/container/myapp/AddressBookDirect.java @@ -1,15 +1,9 @@ package io.trygvis.container.myapp; -import io.trygvis.persistence.sql.SqlExecutor; - import java.io.BufferedReader; import java.io.EOFException; import java.io.InputStreamReader; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; import java.sql.SQLException; -import java.util.ArrayList; import java.util.List; import static io.trygvis.container.myapp.Contact.Gender.FEMALE; @@ -215,7 +209,8 @@ public class AddressBookDirect { } Company company = null; - Contact o = new Contact(name, g, company); + Contact o = new Contact(name, g); + o.company = session.company.selectById(1l); session.contact.insert(o); } diff --git a/myapp/src/main/java/io/trygvis/container/myapp/AddressBookJpa.java b/myapp/src/main/java/io/trygvis/container/myapp/AddressBookJpa.java index 3981805..75e923a 100644 --- a/myapp/src/main/java/io/trygvis/container/myapp/AddressBookJpa.java +++ b/myapp/src/main/java/io/trygvis/container/myapp/AddressBookJpa.java @@ -18,7 +18,7 @@ import static io.trygvis.container.myapp.Contact.Gender.FEMALE; import static io.trygvis.container.myapp.Contact.Gender.MALE; public class AddressBookJpa { - +/* private BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); private EntityManager entityManager; @@ -239,4 +239,5 @@ public class AddressBookJpa { } System.out.println(); } +*/ } diff --git a/myapp/src/main/java/io/trygvis/container/myapp/Contact.java b/myapp/src/main/java/io/trygvis/container/myapp/Contact.java index 5ce87c7..1ef5adb 100644 --- a/myapp/src/main/java/io/trygvis/container/myapp/Contact.java +++ b/myapp/src/main/java/io/trygvis/container/myapp/Contact.java @@ -16,11 +16,10 @@ public class Contact extends AbstractEntity { public final Gender gender; - public final Company company; + public Company company; - public Contact(String name, Gender gender, Company company) { + public Contact(String name, Gender gender) { this.name = name; this.gender = gender; - this.company = company; } } |