Re: Cayenne 3 with Oracle 8

From: Bryan Lewis (jbryanlewi..mail.com)
Date: Mon Apr 13 2009 - 16:50:08 EDT

  • Next message: Weddle, Anthony: "RE: General queries"

    I think that sets a new record for responsiveness. I've frequently told a
    story to open-source skeptics how I got a fix in only 3 hours. This one was
    about 2:20. :-)

    Yes, that fixes my test case on Oracle 8i. The SQL it generates now is:

      SELECT DISTINCT t0.* FROM ROLE t0, EMPLOYEE_ROLE t1
      WHERE t1.EMPLOYEE_ID = ?
      AND t0.ROLE_ID = t1.ROLE_ID

    Thanks!

    (I'm getting accustomed to this maven thing too.)

    On Mon, Apr 13, 2009 at 2:54 PM, Andrus Adamchik <andru..bjectstyle.org>wrote:

    > In fact switching back to the legacy join syntax was already accomplished
    > for OpenBase (see OpenBaseJoinStack) :
    >
    > https://issues.apache.org/jira/browse/CAY-1084
    >
    > So I just cloned it for Oracle8:
    >
    > https://issues.apache.org/jira/browse/CAY-1207
    >
    > This code is committed, I just don't have a way to test it. Bryan, you can
    > build Cayenne from trunk or grab it from Hudson CI once it rebuilds my
    > latest changes:
    >
    >
    > http://hudson.zones.apache.org/hudson/view/Cayenne/job/Cayenne-trunk/org.apache.cayenne$cayenne-server/
    >
    > Andrus
    >
    >
    >
    > On Apr 13, 2009, at 7:58 PM, Bryan Lewis wrote:
    >
    > Thanks. About what I thought. Just wanted to check.
    >>
    >>
    >> On Mon, Apr 13, 2009 at 12:41 PM, Mike Kienenberger <mkienen..mail.com
    >> >wrote:
    >>
    >> By the way, when I say "could be added back in", I am not volunteering
    >>> to do the work, only letting you know that you could probably figure
    >>> out how to submit patches to do this by looking at Cayenne 2 code and
    >>> porting to Cayenne 3.
    >>>
    >>> On Mon, Apr 13, 2009 at 12:40 PM, Mike Kienenberger <mkienen..mail.com>
    >>> wrote:
    >>>
    >>>> Yes, you need Oracle 9 before that syntax is understood.
    >>>>
    >>>> Oracle 8 only understands select * from t1, t2 where t1.x = t2.x. I
    >>>> suppose the old oracle inner join support could be added back in.
    >>>>
    >>>> Outer join support is even worse for 8, and not implementable for all
    >>>> practical purposes.
    >>>>
    >>>>
    >>>> On Mon, Apr 13, 2009 at 12:32 PM, Bryan Lewis <jbryanlewi..mail.com>
    >>>>
    >>> wrote:
    >>>
    >>>> We have some apps running on an Oracle 8i database. Wow, almost 10
    >>>>>
    >>>> years
    >>>
    >>>> old. Cayenne 2 has been working great. When I tried updating to
    >>>>>
    >>>> Cayenne 3,
    >>>
    >>>> I got a syntax error in a particular bit of SQL with a JOIN. This isn't
    >>>>>
    >>>> an
    >>>
    >>>> urgent problem for us but I thought I'd mention it.
    >>>>>
    >>>>> We have an Employee entity with a many-to-many relationship to Role.
    >>>>>
    >>>> With a
    >>>
    >>>> join table called Employee_Role.
    >>>>>
    >>>>> List roles = employee.getRoles();
    >>>>> Role role = roles.get(0);
    >>>>>
    >>>>> The first fetch works but resolving the first element generates this
    >>>>>
    >>>> SQL:
    >>>
    >>>>
    >>>>> SELECT DISTINCT t0.* FROM ROLE t0
    >>>>> JOIN EMPLOYEE_ROLE t1 ON
    >>>>> (t0.ROLE_ID = t1.ROLE_ID)
    >>>>> WHERE t1.EMPLOYEE_ID = ? [bind: 1:312]
    >>>>>
    >>>>> Oracle 8i doesn't understand that JOIN...ON syntax and throws:
    >>>>>
    >>>>> java.sql.SQLException: ORA-00933: SQL command not properly ended
    >>>>>
    >>>>> The same code works fine on PostgreSQL with almost the same generated
    >>>>>
    >>>> SQL.
    >>>
    >>>>
    >>>>>
    >>>>
    >>>
    >



    This archive was generated by hypermail 2.0.0 : Mon Apr 13 2009 - 16:57:25 EDT