]> git.mxchange.org Git - jcustomer-core.git/commitdiff
fixed referenced table
authorRoland Haeder <roland@mxchange.org>
Tue, 29 Sep 2015 07:16:40 +0000 (09:16 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 29 Sep 2015 07:16:40 +0000 (09:16 +0200)
Signed-off-by:Roland Häder <roland@mxchange.org>

src/org/mxchange/jshopcore/model/product/GenericProduct.java

index 99ba27c699ab783dd8068598329d62317b935f0c..e9ac607df776d39794758c03171dcb89a2e06fbf 100644 (file)
@@ -23,8 +23,11 @@ import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
 import javax.persistence.Table;
 import org.mxchange.jshopcore.model.category.Category;
+import org.mxchange.jshopcore.model.category.ProductCategory;
 
 /**
  * Generic product class
@@ -51,7 +54,8 @@ public class GenericProduct implements Product, Comparable<Product> {
         * Product productCategory
         */
        @Basic (optional = false)
-       @Column (name = "category_id", length = 20, nullable = false)
+       @JoinColumn(name = "category_id", nullable = false, updatable = false)
+       @OneToOne(targetEntity = ProductCategory.class, optional = false)
        private Category productCategory;
 
        /**