EOSQLExpression for Query across optional relationships?
EOSQLExpression for Query across optional relationships?
- Subject: EOSQLExpression for Query across optional relationships?
- From: Kieran Kelleher <email@hidden>
- Date: Fri, 15 Oct 2010 12:14:27 -0400
An old issue, but just wanted to throw this out there for discussion.
If I do a query (against MySQL db) where some of the keypaths cross optional relationships, then the results will exclude master entity instances where the optional detail does not exist. This is because of the SQL generated (for the default MySQL plugin anyway) does its table joins using WHERE t0.id = t1.idForeignKey style expressions.
So, how do others deal with this?
Is this an EOF problem or a MySQL plugin problem? Do other databases/plugins exhibit this same problem? .... or do they automatically generate LEFT JOIN between the master entity table and the related tables as derived from the keyPaths?
Is it straightforward to implement, or a huge task? ..... is a case of just adding this functionality to the MySQLExpression (extends JDBCExpression) class, and overriding assembleJoinClause? Does EOF actually send the appropriate left-outer or right-outer join semantic to that method when appropriate anyway? Must I configure left outer join semantics in the EOModel in advance for my optional detail relationships for this to work?
Pointers, advice, experiences would be much appreciated :-)
-Kieran
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden