Re: empty relationship qualifier question
Re: empty relationship qualifier question
- Subject: Re: empty relationship qualifier question
- From: "Michael Bushkov" <email@hidden>
- Date: Tue, 8 Jul 2008 12:43:44 +0400
Hi, Pierre! Thanks for the answer.
I've actually tried using EOKeyValueQualifier("tracks",
EOQualifier.QualifierOperatorEquals, NSKeyValueCoding.NullValue). It
generates the following sql, which is just wrong:
SELECT RTRIM(t0.artist), t0.guitarProSongId, t0.id, RTRIM(t0.title)
FROM Song t0 WHERE t0.id is NULL
Considering, ExistsInRelationshipQualifier - does it support sql
generation (I didn't see it in its code)?
On Sat, Jul 5, 2008 at 1:17 AM, Pierre Bernard <email@hidden> wrote:
> Hi!
>
> Actually, EOKeyValueQualifier("tracks", EOQualifier.QualifierOperatorEquals,
> NSKeyValueCoding.NullValue) should work just fine.
>
> Please report back if it doesn't. I'd like to know.
>
> An alternative - usually used only for more complex cases - would be to use
> the ExistsInRelationshipQualifier from my Houdah WebObjects frameworks
> project.
>
> Best,
> Pierre Bernard
> Houdah Software s.à r.l.
>
> On 4 Jul 2008, at 10:32, Michael Bushkov wrote:
>
>> Hi,
>> I have quite simple task, but I don't see any proper solution. The
>> task is as follows:
>> I have 2 entities - Song and Track. Song has a one-to-many
>> relationship to Track (Song->tracks). And I need to fetch all songs
>> which have no tracks. That's all - plain and simple.
>>
>> I've looked through the list of available qualifiers and even started
>> to write one by myself, but it looks like an overkill for such a
>> simple task. The straightforward solution, that I see is to cache
>> number of tracks in Song entity (make a Song->tracksNumber field). But
>> it looks like modifying model for implementation purposes (this
>> however can be very effective on large datasets, because such database
>> structure doesn't require using subqueries to find songs with no
>> tracks).
>>
>> Any suggestions are greatly appreciated )
>>
>> --
>> With best regards,
>> Michael Bushkov
>> _______________________________________________
>> 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
>
> ---
> Pierre Bernard
> http://www.bernard-web.com/pierre
> http://www.houdah.com
>
>
>
>
--
With best regards,
Michael Bushkov
_______________________________________________
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