我的TableX参考了TableY.
@JoinColumn(name = "idTableY", referencedColumnName = "idTableY")
@ManyToOne(optional = false, fetch=FetchType.LAZY)
private TableY idTableY;
Run Code Online (Sandbox Code Playgroud)
我收到这个错误.
<openjpa-2.0.0-r422266:935683 fatal user error> org.apache.openjpa.persistence.ArgumentException
"com.mycompany.entities.TableX.idTableY" has columns with targets, but OpenJPA does not support any joins on this mapping in this context.
Run Code Online (Sandbox Code Playgroud)
表Y有这个代码:
@OneToMany(cascade = CascadeType.ALL, mappedBy = "idTableY")
private Collection<TableX> tableXCollection;
Run Code Online (Sandbox Code Playgroud)
这个生成的eclipse-link代码是100%正常的(所有其他具有类似代码的实体/表都没有问题).
但其中有几个正在犯这样的错误.知道为什么吗?
小智 5
我得到了这个确切的错误,但对我来说,修复是将TableY添加到persistence.xml中持久性单元的类列表中.对我来说,TableY是一个全新的实体.我在它上面使用了@JoinColumn,它运行正常.
| 归档时间: |
|
| 查看次数: |
2271 次 |
| 最近记录: |