Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] LEFT OUTER JOIN not being honored

I've got the following JPQL query defined:


select object(o) from NotificationDefinition as o LEFT JOIN o.sieve as s 

where ((o.resource = :resource and o.severity is null) or (o.resource is
null and o.severity = :severity))

and ((o.include = true and o.organization = :organization) or (o.include =
false and o.organization <> :organization) or (o.sieve is null))

But the generated SQL is as follows:


SELECT
  t0.id
, t0.mod_date
, t0.create_date
, t0.version
, t0.sieve
, t0.mod_by
, t0.resource_id
, t0.severity
, t0.distribution_id
FROM
  notification_definition t0
, distribution_sieve t1
WHERE
  (
    (
      (
        (
          (
            t0.resource_id = ?
          )
        AND
          (
            t0.severity IS NULL
          )
        )
      OR
        (
          (
            t0.resource_id IS NULL
          )
        AND
          (
            t0.severity = ?
          )
        )
      )
    AND
      (
        (
          (
            (
              t1.include = 1
            )
          AND
            (
              t1.organization = ?
            )
          )
        OR
          (
            (
              t1.include = 0
            )
          AND
            NOT
            (
              (
                t1.organization = ?
              )
            )
          )
        )
      OR
        (
          t0.sieve IS NULL
        )
      )
    )
  AND
    (
      t1.id = t0.sieve
    )
  )



The SQL being generated is performing an inner join when what I want is an
outer.



      t1.id = t0.sieve


This is causing me to find no matching rows. How can I get around this?

Thanks for the help...

-- 
View this message in context: http://www.nabble.com/LEFT-OUTER-JOIN-not-being-honored-tp23341277p23341277.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.

Back to the top