[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] Potential bug in EclipseLink
|
Hello Michael,
Because you are using x.claim.id, this causes an inner join to be used.
You will need to specify an outer join in the from clause:
SELECT x FROM Depot x outer join x.claim claim WHERE x.scenario = :currentScenario and (claim is null or claim.id in(%s))
Best Regards,
Chris
On 07/09/2010 8:13 AM, Michael Simons wrote:
Hello,
JPQL-Query:
SELECT x FROM Depot x WHERE x.scenario = :currentScenario and (x.claim is null or x.claim.id in
(%s))
is transalted to the following SQL:
SELECT t1.depot_id, t1.bot_pump_rate, t1.available, t1.ext_id, t1.jdo_version, t1.name3,
t1.avg_wait, t1.top_pump_rate, t1.nme, t1.name2, t1.alt_ex_id, t1.depot_type_id, t1.claim_id,
t1.schedule_id, t1.corporate_id, t1.measure_id, t1.lcation_id, t1.scenario_id, t0.claim_id,
t0.description, t0.nme
FROM claim t0, depot t1
WHERE (((t1.scenario_id = ?)
AND ((t1.claim_id IS NULL) OR (t0.claim_id IN (?, ?, ?, ?, ?, ?))))
AND (t0.claim_id = t1.claim_id))
This is not correct because the natural join of the claim table suppresses the lines in t1 with
a claim_id of NULL, but these lines must also be selected.
Do I fail or did EL fail here?
Kind Regards,
Michael
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users