From: Roland Haeder Date: Thu, 24 Sep 2015 09:49:21 +0000 (+0200) Subject: @JoinColumn and @Column doesn't work together X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=259ce1f09e98138a7884089f72c0624d228c8d73;p=jproduct-core.git @JoinColumn and @Column doesn't work together Signed-off-by:Roland Häder --- 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; /**