Re: ERXKey to check to many relationship is null
Re: ERXKey to check to many relationship is null
- Subject: Re: ERXKey to check to many relationship is null
- From: David Avendasora <email@hidden>
- Date: Mon, 19 May 2014 11:12:06 -0400
Hi Oscar,
Keep in mind, you do not war to check for null, as a to-many relationship on an EO will not ever be null (except when in the process of initially creating an EO in the first place). It will be “empty” as in it will return an NSArray with zero elements in it.
The good news is that as of about a month ago, ERXKey now has the following convenience methods to create the following qualifiers:
isEmptyRelationship()
To get the qualifier you would write: EOQualifier thatDoNotHaveAnAddress = Person.ADDRESSES.isEmptyRelationship();
You can use that in a fetch or to filter a NSArray<Person>.
It really is that easy now. Hard to believe it took that long for WO to be able to do something that simple.
Dave
On May 15, 2014, at 5:07 PM, Oscar González < email@hidden> wrote:
Hi list,I'm trying to generate a ERXKey to check to many relationship is null in the database. Person-->>Address I want all the persons that have no address.
—————————————————————————————
WebObjects - so easy that even Dave Avendasora can do it!™ ————————————————————————————— David Avendasora Senior Software Abuser Nekesto, Inc.
|
_______________________________________________
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