Re: Has anyone seen a problem with LEFT JOINs in WO 5.2 and MySql?
Re: Has anyone seen a problem with LEFT JOINs in WO 5.2 and MySql?
- Subject: Re: Has anyone seen a problem with LEFT JOINs in WO 5.2 and MySql?
- From: Brent Shank <email@hidden>
- Date: Mon, 3 Feb 2003 18:25:00 -0800
Hi Scott,
WebObjects/EOF generates SQL that complies more closely to the SQL 89
standard rather than the SQL 92 standard. As such, it doesn't really
support all the various join types specified in SQL 92. As you
discovered, it does generate the "correct" join syntax for Oracle,
since Oracle doesn't really comply with the 92 spec either. (I quote
"correct" because Oracle doesn't support left, right, or full outer
joins).
If you need to do a left outer join, I suppose you could query the db
and get back the rows in the query, then query the left table in the
join condition to fetch all rows. Then, filter out the duplicates you
received from the first query (since a left outer join is the rows
matching the predicate + the rows in the left table of the join
condition). You essentially get the effect of a left outer join.
This is pretty ugly but it might save you from writing raw SQL. But if
that doesn't scare you, the better (though less database-independent)
solution is probably to fetch raw rows with a SQL expression that
includes whatever join syntax you want. See
http://developer.apple.com/techpubs/webobjects/Reference/API/com/
webobjects/eoaccess/
EOUtilities.html#rawRowsForSQL(com.webobjects.eocontrol.EOEditingContext
, java.lang.String, java.lang.String) .
Brent
On Monday, February 3, 2003, at 05:52 PM, Scott Ellsworth wrote:
Hello.
I have searched the archives, but did not spot anything like this.
One of my coworkers has reported that a to-many with LEFT OUTER JOINs
do not work.correctly with WO 5.1 and MySql 3.23.53 or 4.0.9.
Apparently, the wrong syntax is generated and the joins fail. This
same model works with correctly with Oracle.
I have just downloaded 5.2, and have worked through the tutorials, so
I suspect I am not really skilled enough yet to debug such a beast.
Before I spend serious time trying to reproduce this, does this
problem sound familiar to anyone else? I believe she is using a
fairly early mysql driver, and is using 5.1.
Scott
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.