小编Thi*_*ues的帖子

带有 ElementCollection 的 JPA 标准

我有这样的事情:

@Entity
public class Person {

    @ElementCollection
    private List<String> emails;
    ...
}
Run Code Online (Sandbox Code Playgroud)

如何将以下 JPQL 转换为条件查询:

select p from Person p
where exists (
    select 1 
    from p.emails e
    where e like :email
)
Run Code Online (Sandbox Code Playgroud)

java jpa jpql criteria-api

4
推荐指数
1
解决办法
2986
查看次数

标签 统计

criteria-api ×1

java ×1

jpa ×1

jpql ×1