]> git.mxchange.org Git - jshop-core.git/commitdiff
@JoinColumn and @Column doesn't work together
authorRoland Haeder <roland@mxchange.org>
Thu, 24 Sep 2015 09:49:21 +0000 (11:49 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 24 Sep 2015 09:49:21 +0000 (11:49 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/jshopcore/model/customer/ShopCustomer.java
src/org/mxchange/jshopcore/model/order/ShopOrder.java

index 678cbb88e43382d38984fbbe47883e1c3ced8edd..42811374a2be73cc0f4a8c40ae1861634f6915e1 100644 (file)
@@ -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;
 
        /**
index 09c69b8cae2a4e7774e5af4c644a63b0ddf6ca3e..0aaa1a0438ca21e0aa11cc0656b14e79a729c388 100644 (file)
@@ -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;
 
        /**