Jin*_*won 2 collections jpa jpql
我的Profile类有一个集合属性。
class Profile {
private List<String> aliases;
}
Run Code Online (Sandbox Code Playgroud)
如何查询选择包含任何给定集合的Profiles ?aliases
比如说,选择别名包含 [ a、b、c] 中的任何一个的配置文件?
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)
| 归档时间: |
|
| 查看次数: |
2669 次 |
| 最近记录: |