私は現在JPA(EclipseLink)を使用していますが、OneToMany関係のtargetEntityパラメータが原因で停止しています。targetEntity in OneToMany JPA関係とAbstractClass
@Entity
@Table(name = "INVENTORY")
public class InventoryJPA implements IInventory {
/**
* Unique identifier of the inventory
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID")
private int id;
/**
* The list of resources avalible in the inventory.
*/
private transient Map<Resource, Integer> resources = null;
/**
* The list of items in the inventory.
*/
@OneToMany(targetEntity = AbstractItemJPA.class,
cascade = CascadeType.ALL)
private List<IItem> items = null;
私はimplItemのAbstractItemJPAクラスを持っています。 IItemインタフェース。 その他AbstractItemJPAを拡張する抽象クラス。
これは一例です:
@MappedSuperclass
public abstract class AbstractControlItemJPA extends AbstractItemJPA implements IControlItem
EclipseLinkのはtargetEntityパラメータにAbstractClassを望んでいないようです。
@OneToMany(targetEntity = AbstractItemJPA.class,
cascade = CascadeType.ALL)
private List<IItem> items = null;
このための解決策はありますか?
ありがとうございました!