• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: qualifier with (NULL or joined value)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: qualifier with (NULL or joined value)?


  • Subject: Re: qualifier with (NULL or joined value)?
  • From: Chuck Hill <email@hidden>
  • Date: Tue, 26 Apr 2016 17:23:06 +0000
  • Thread-topic: qualifier with (NULL or joined value)?

It is a database thing, you need to model the relationship as an outer join.

Chuck




On 2016-04-26, 9:45 AM, "webobjects-dev-bounces+chill=email@hidden on behalf of OC" <webobjects-dev-bounces+chill=email@hidden on behalf of email@hidden> wrote:

>Hi there,
>
>I would need to fetch objects with qualifier
>
>===
>EOQualifier.qualifierWithQualifierFormat("owner.userType = %@ OR owner = NULL",new NSArray(pc.userType))
>===
>
>where "owner" is a :1 relationship based on C_OWNER_ID foreign key. That, alas, does not work at all. It generates a SQL
>
>===
>SELECT ... FROM "T_COMPETENCE" t0, "T_USER" T1 WHERE (t0."C_OWNER_ID" is NULL OR T1."C_USER_TYPE" = 9) AND t0."C_OWNER_ID" = T1."C_UID"
>===
>
>which never returns any row whose "owner"/C_OWNER_ID is NULL, for the latter part of WHERE (AND t0."C_OWNER_ID" = T1."C_UID") prevents it.
>
>Is this a WebObjects bug or a database bug?
>
>Is there a way to write directly a qualifier which would work properly, i.e., same way as my extremely ugly work-around code of
>
>===
>def all=new NSMutableArray()
>def nulls=... fetch with q-format ... "owner = NULL"
>if (nulls) all.addObjectsFromArray(nulls)
>def types=... fetch with q-format ... "owner.userType = %@",pc.userType
>if (types) all.addObjectsFromArray(types)
>return all
>===
>
>does?
>
>Thanks,
>OC
>
>
> _______________________________________________
>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

 _______________________________________________
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


References: 
 >qualifier with (NULL or joined value)? (From: OC <email@hidden>)

  • Prev by Date: qualifier with (NULL or joined value)?
  • Next by Date: Disable generation of compressed build artifacts in Maven
  • Previous by thread: qualifier with (NULL or joined value)?
  • Next by thread: Disable generation of compressed build artifacts in Maven
  • Index(es):
    • Date
    • Thread