我有一个像这样的抽象实体
@Entity
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
public abstract class LaunchEntity implements Serializable {
我的另一个“产品类”
@Entity
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
@Table(name = "PC_PRODUCT")
public abstract class Product
extends LaunchEntity {
@XmlElement(name = "Product_To_Product")
@OneToMany(mappedBy = "product")
protected List<ProductRelation> productToProduct;
另一方面,在ProductRelation对象中,我有列表映射
@Entity
@Table(name = "PC_PRODUCT_RELATION")
public class ProductRelation extends RelationEntity {
private static final long serialVersionUID = 1L;
public ProductRelation() {
super();
}
@XmlElement(name = "Product", required = true)
@ManyToOne
protected Product product;
我试图坚持一个具有许多产品关系的对象,但我的产品关系表仍然没有数据库中的任何记录。
我可以做些什么来解决这个问题?