1 Reply Latest reply: Apr 17, 2012 10:04 AM by JamesSutherland RSS

    Critera query with SetJoin

    930906
      Hi Guys,

      I am looking how to create below query using JPA critera type safe queries:

      select user0_.USER_ID from +USERS user0_ left outer join USER_CATALOG usercatalo1_ on user0_.USER_ID=usercatalo1_.USER_ID and usercatalo1_.ACTIVE=1+ where user0_.USER_NAME='admin1';

      I can put and usercatalo1.ACTIVE=1_ this condition using Predicate but this adds this after where clause and this gives me the result what I dont need.

      Thanks in Advance
        • 1. Re: Critera query with SetJoin
          JamesSutherland
          EclipseLink 2.3 does not support an ON clause. You can only do this in a native SQL query, or through defining a query key.

          EclipseLink 2.4 (and JPA 2.1) will have support for an ON clause. You could try the latest 2.4 build.
          2.4 only provides ON support in JPQL and Expressions, not yet Criteria. But you can mix Expressions with Criteria using JpaCriteriaBuilder toExpression/fromExpression.