• 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
qualifier with (NULL or joined value)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

qualifier with (NULL or joined value)?


  • Subject: qualifier with (NULL or joined value)?
  • From: OC <email@hidden>
  • Date: Tue, 26 Apr 2016 18:45:39 +0200

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


  • Follow-Ups:
    • Re: qualifier with (NULL or joined value)?
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: 'er.ajax.AjaxResponse' exists but is not a subclass of WOComponent.
  • Next by Date: Re: qualifier with (NULL or joined value)?
  • Previous by thread: [SOLVED]-Re: 'er.ajax.AjaxResponse' exists but is not a subclass of WOComponent.
  • Next by thread: Re: qualifier with (NULL or joined value)?
  • Index(es):
    • Date
    • Thread