diff options
Diffstat (limited to 'myapp')
-rw-r--r-- | myapp/src/main/java/io/trygvis/container/myapp/AddressBookDirect.java | 8 |
1 files changed, 7 insertions, 1 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 b272649..7cb6b54 100644 --- a/myapp/src/main/java/io/trygvis/container/myapp/AddressBookDirect.java +++ b/myapp/src/main/java/io/trygvis/container/myapp/AddressBookDirect.java @@ -208,7 +208,6 @@ public class AddressBookDirect { } } - Company company = null; Contact o = new Contact(name, g); o.company = session.company.selectById(1l); session.contact.insert(o); @@ -225,6 +224,13 @@ public class AddressBookDirect { System.out.println("Id: " + contact.getId()); System.out.println("Name: " + contact.name); System.out.println("Gender: " + contact.gender); + if (contact.company != null) { + System.out.println("Company:"); + System.out.println(" id: " + contact.company.getId()); + System.out.println(" name: " + contact.company.name); + } else { + System.out.println("Company: <none>"); + } } System.out.println(); } |