【发布时间】:2015-03-17 15:45:26
【问题描述】:
我有以下无法创建的实体:
@OneToMany( fetch = FetchType.LAZY, orphanRemoval=true, mappedBy="itemA" )
@Cascade( { CascadeType.ALL } )
@MapKey( name="id.customKey" )
private Map<String, ItemB> bMap;
它给了我一个:
Invocation of init method failed; nested exception is org.hibernate.AnnotationException: mappedBy reference an unknown target entity property
ManyToOne 类属性如下:
@ManyToOne( optional=false )
@NotFound( action=NotFoundAction.EXCEPTION )
@JoinColumn( name="ID_ITEM_B", nullable=false, updatable=true, insertable=true )
private ItemA itemA;
这段代码似乎在 ItemB 列表中运行良好,但当我使用 Map 时出现问题......怎么会?
【问题讨论】: