【发布时间】:2020-07-01 20:22:13
【问题描述】:
我有一个使用此语法构建的 JPA 规范
newSpec = (root, query, cb) -> {
return cb.equal(root.get("livelloApprovazione"), root.join( "utentiInteressati").get("livello"));
};
正确映射到我所关注的本机 SQL:
select ....
from documento documento0_
inner join documento_utenti utentiinte1_
on documento0_.id_documento=utentiinte1_.id_documento
where documento0_.livello_approvazione=utentiinte1_.livello
我需要在条件的左侧添加一个+1表达式
select ....
....
where documento0_.livello_approvazione + 1 = utentiinte1_.livello
在条件的一侧加上额外的表达式 + 1。
是否可以实现 JPA 规范谓词这样的 where 条件?如果有怎么办?
【问题讨论】: