diff options
Diffstat (limited to 'proxy/code/src/org/fedoraproject/candlepin/model/Product.java')
-rw-r--r-- | proxy/code/src/org/fedoraproject/candlepin/model/Product.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/Product.java b/proxy/code/src/org/fedoraproject/candlepin/model/Product.java index 127287c..18447f1 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/Product.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/Product.java @@ -30,6 +30,7 @@ import javax.persistence.Table; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; +import org.hibernate.annotations.ForeignKey; /** * Represents a Product that can be consumed and entitled. Products define @@ -55,6 +56,8 @@ public class Product { private String name; @OneToMany(targetEntity=Product.class, cascade=CascadeType.ALL) + @ForeignKey(name = "fk_product_product_id", + inverseName = "fk_product_child_product_id") @JoinTable(name="cp_product_hierarchy", joinColumns=@JoinColumn(name="PARENT_PRODUCT_ID"), inverseJoinColumns=@JoinColumn(name="CHILD_PRODUCT_ID")) |