[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.rt.eclipselink] left join implementation for informix problem

Hi,


I'm using Sun Java System Application Server 9.1_02, Java Persistence implementation is toplink included with the server.
My Infomix version is IDS 11.50


The following Java Persistance query:

SELECT DISTINCT a.key1, a.key2, a.key3, a.key4, c.preference, ......
FROM Product a LEFT JOIN a.refSupHeader b LEFT JOIN b.refSup c WHERE a.type = ?1 ORDER BY a.key1, a.key2, a.key3, a.key4, c.rowNb


for Informix is translated as:

SELECT DISTINCT t0.KEY1, t0.KEY2, t0.KEY3, t0.KEY4, t1.PREFERENCE, ... FROM p_product t0, OUTER p_ref_sup_header t2, p_ref_sup t1 WHERE ((t0.TYPE = ?) AND ((t2.ID = t0.p_ref_sup_header_id) AND (t1.p_ref_sup_header_id = t2.ID))) ORDER BY t0.KEY1 ASC, t0.KEY2 ASC, t0.KEY3 ASC, t0.KEY4 ASC, t1.row_nb ASC
bind => [MAT]

what is totaly wrong. Infomix supports LEFT JOIN, why Java Persistance is using old OUTER syntax?


The proper query syntax, generated by JP for other database servers is:

SELECT DISTINCT t0.KEY1, t0.KEY2, t0.KEY3, t0.KEY4, t1.PREFERENCE, ......
FROM p_product t0 LEFT OUTER JOIN p_ref_sup_header t2 ON (t2.ID = t0.p_ref_sup_header_id) LEFT OUTER JOIN p_ref_sup t1 ON (t1.p_ref_sup_header_id = t2.ID) WHERE (t0.TYPE = ?) ORDER BY t0.KEY1 ASC, t0.KEY2 ASC, t0.KEY3 ASC, t0.KEY4 ASC, t1.row_nb ASC
bind => [MAT]

The above query works properly in infomix database when executed in dbaccess tool. Is there a way to force Java Persistence to generate right query syntax like above?


Thank you very match for any help.
Janusz