有什么方法可以选择包含任何其他集合元素的集合吗?

Jin*_*won 2 collections jpa jpql

我的Profile类有一个集合属性。

class Profile {
    private List<String> aliases;
}
Run Code Online (Sandbox Code Playgroud)

如何查询选择包含任何给定集合的Profiles ?aliases

比如说,选择别名包含 [ abc] 中的任何一个的配置文件?

Pet*_*ály 6

where 'a' member of p.aliases or 'b' member of p.aliases or 'c' member of p.aliases
Run Code Online (Sandbox Code Playgroud)

或者

join p.aliases a where a in ('a','b','c')
Run Code Online (Sandbox Code Playgroud)