JPA Criteria API: Multiple condition on LEFT JOIN

后端 未结 2 447
别那么骄傲
别那么骄傲 2020-12-10 06:34

I have a join reference like following for which the first join expression is constructed by the JPA API automatically.

CriteriaBuilder cb = entityManager.ge         


        
2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-10 07:29

    JPA always joins by the mapping join columns, only. JPA 2.0 does not support an ON clause, but the 2.1 draft does have this support.

    EclipseLink 2.4 has support for an ON clause,

    See, http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Querying/JPQL#ON

    It is also possible through the Criteria API, using the EclipseLink native Expression API that provides on clause support,

    See, http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Querying/Criteria#JpaCriteriaBuilder_and_EclipseLink_Extensions

提交回复
热议问题