是否有可能在 ON 子句中添加更多连接条件?例如:
select * from table t left join second_table st ON t.id = st.id_second AND st.something = 2;
我的代码是:
CriteriaBuilder builder = em.getCriteriaBuilder();
Order o;
CriteriaQuery<Documentation> select = builder.createQuery(Documentation.class);
Root<Documentation> u = select.from(Documentation.class);
Join<Documentation, DocumentationUser> dul = u.join("documentationUserCollection", JoinType.LEFT);