From 259ce1f09e98138a7884089f72c0624d228c8d73 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 24 Sep 2015 11:49:21 +0200 Subject: [PATCH] =?utf8?q?@JoinColumn=20and=20@Column=20doesn't=20work=20t?= =?utf8?q?ogether=20Signed-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/org/mxchange/jshopcore/model/customer/ShopCustomer.java | 3 +-- src/org/mxchange/jshopcore/model/order/ShopOrder.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/org/mxchange/jshopcore/model/customer/ShopCustomer.java b/src/org/mxchange/jshopcore/model/customer/ShopCustomer.java index 678cbb8..4281137 100644 --- a/src/org/mxchange/jshopcore/model/customer/ShopCustomer.java +++ b/src/org/mxchange/jshopcore/model/customer/ShopCustomer.java @@ -56,9 +56,8 @@ public class ShopCustomer implements Customer { /** * Id number from "contacts" table */ - @JoinColumn (table = "contacts", unique = true) + @JoinColumn (table = "contacts", referencedColumnName = "customer_contact_id", name = "id", nullable = false, updatable = false, unique = true) @OneToOne (optional = false, targetEntity = BaseContact.class, orphanRemoval = true) - @Column (name = "customer_contact_id", nullable = false, length = 20) private Contact contact; /** diff --git a/src/org/mxchange/jshopcore/model/order/ShopOrder.java b/src/org/mxchange/jshopcore/model/order/ShopOrder.java index 09c69b8..0aaa1a0 100644 --- a/src/org/mxchange/jshopcore/model/order/ShopOrder.java +++ b/src/org/mxchange/jshopcore/model/order/ShopOrder.java @@ -59,7 +59,7 @@ public class ShopOrder implements Orderable { */ @Basic (optional = false) @OneToMany - @JoinColumn (name = "customer_id", nullable = false, updatable = false) + @JoinColumn (table = "customer", referencedColumnName = "id", name = "customer_id", nullable = false, updatable = false) private Customer customer; /** -- 2.39.5