Jpa 加入@manytone';s@OneToMany 通过@ManyToOne 通过@OneToMany
对于给定的Jpa 加入@manytone';s@OneToMany 通过@ManyToOne 通过@OneToMany,jpa,join,criteria-api,Jpa,Join,Criteria Api,对于给定的根,如何将这些阴影连接起来,以便在何处为它们设置一些条件 final Root<Account> account; final Path<Origin> origin = account.get(Account_.origin); 最终根帐户; 最终路径原点=account.get(account.origin); 如果Origin实体中的@OneToMany属性名为shadows,则需要按如下方式使用: Join<Origin, Shadow>
根
,如何将这些阴影
连接起来,以便在何处为它们设置一些条件
final Root<Account> account;
final Path<Origin> origin = account.get(Account_.origin);
最终根帐户;
最终路径原点=account.get(account.origin);
如果Origin
实体中的@OneToMany
属性名为shadows
,则需要按如下方式使用:
Join<Origin, Shadow> shadows = origin.join(Origin_.shadows);
如果
Origin
实体中的@OneToMany
属性被称为shadows
,则需要按如下方式使用:
Join<Origin, Shadow> shadows = origin.join(Origin_.shadows);
JPA是jpa1.0还是jpa2.0?你能使用Root吗?在我的应用程序中,我使用join()方法,你可以看看。我不知道它是否有效,所以我决定不发布我的答案。JPA是jpa1.0还是jpa2.0?你能使用Root吗?在我的应用程序中,我使用join()方法,你可以看看。我不知道它是否有效,所以我决定不发布我的答案。