From: Roland Haeder Date: Tue, 29 Sep 2015 07:16:40 +0000 (+0200) Subject: fixed referenced table X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c6fa6180a1e98a7c37492b2482f9a30e3b782793;p=jcustomer-core.git fixed referenced table Signed-off-by:Roland Häder --- diff --git a/src/org/mxchange/jshopcore/model/product/GenericProduct.java b/src/org/mxchange/jshopcore/model/product/GenericProduct.java index 99ba27c..e9ac607 100644 --- a/src/org/mxchange/jshopcore/model/product/GenericProduct.java +++ b/src/org/mxchange/jshopcore/model/product/GenericProduct.java @@ -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 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; /**