Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jpa 加入@manytone';s@OneToMany 通过@ManyToOne 通过@OneToMany_Jpa_Join_Criteria Api - Fatal编程技术网

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()方法,你可以看看。我不知道它是否有效,所以我决定不发布我的答案。