Re: control select joins with EJBQL

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Jun 12 2007 - 01:40:10 EDT

  • Next message: Andrus Adamchik: "Re: SoC code in SVN?"

    On Jun 12, 2007, at 8:35 AM, Andrus Adamchik wrote:

    > SELECT t0.ARTIST_NAME AS ARTIST_NAME, t0.ARTIST_ID AS ARTIST_ID,
    > t0.DATE_OF_BIRTH AS DATE_OF_BIRTH
    > FROM ARTIST AS t0
    > INNER JOIN PAINTING AS t1 ON (t0.ARTIST_ID = t1.ARTIST_ID)
    > INNER JOIN PAINTING AS t2 ON (t1.ARTIST_ID = t2.ARTIST_ID)
    > WHERE t1.PAINTING_TITLE = ? AND t2.PAINTING_TITLE = ? [bind:
    > 'P1', 'P2']

    Umm... looking at the SQL, there's still a bug - the condition must
    be "(t0.ARTIST_ID = t2.ARTIST_ID)" in the second join. Coincidentally
    this particular query still works, but I need to fix the translator.
    Still the point remains - we now have a great deal of control over
    the joins.

    Andrus



    This archive was generated by hypermail 2.0.0 : Tue Jun 12 2007 - 01:40:32 EDT