On 04/06/2008, at 12:58 PM, Chuck Hill wrote:

On Jun 3, 2008, at 7:26 PM, Lachlan Deck wrote:

Hi there,

Say I have entities Foo and Bar (both of which have an attribute isDeleted) and a join FooBar and I create restricting qualifiers for Foo and Bar of (isDeleted IS NULL OR isDeleted = 0).

Foo.fooBars() still fetches all fooBars even if pointing to a Bar that cannot be instantiated due to the restricting qualifier.

So my question is: should EOF filter such joins automatically (i.e., should I file a bug) or is it just up to me to auto-apply these restricting qualifiers?

I would expect that to work for fetches. In the past I have had a relationship to a subclass in a single table inheritance hierarchy, and I recall that only the correct instances were fetched.

Yeah, and I just checked again and I already have code that automatically creates a restricting qualifier for joins by migrating the restricting qualifiers from the related entities. So I end up with:

9837 INFO  [main] (er.extensions.ERXNSLogLog4jBridge, appendln, 38) -
willLoadEntity added restricting qualifier to:FooBar of ((foo.isDeleted <> (java.lang.Boolean)'true') and (bar.isDeleted <> (java.lang.Boolean)'true'))

But maybe the problem is that of null results for these related entities where the qualifier applies.

 I can't see why this should not work, I'd file a bug.

ok.

Have you checked the SQL and verified that they restricting qualifier is not getting generated?

Will have to check again. Thanks.

with regards,
--

Lachlan Deck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to