我与以下实体共同创建了“世界展望组织”项目:事实和项目。
项目内容提及事实。
@RooJavaBean
@RooToString
public class ItemFacture {
@ManyToOne
private Facture facture;
...
这是《事实法典》:
@RooJavaBean
@RooToString
@RooEntity
public class Facture {
private String nom;
private String type;
}
直到此为止。 我想创建一种习俗,选择包含具体事实的所有项目:
@SuppressWarnings("unchecked")
public static List<ItemFacture> findByFacture(Facture facture) {
Query q = entityManager().createQuery("SELECT o FROM ItemFacture AS o WHERE o.facture = :facture");
q.setParameter("facture", facture);
return q.getResultList();
}
当我试图处决这一寻找者时,这给我留下了这一错误:
服务器(Error):现场“装置”在测试中不存在。 项目设计或没有持久性; nes例外是 j, 持久性:在 com测试中不存在实地“装置”。 项目内容
I created a few custom finders and every one of them worked just fine except this one.
I tried adding @Persistent to the field and @PersistenceCapable(identityType = IdentityType.APPLICATION) to Facture but it still doesn t work.
Anyone know what is the problem?