Re: EOSortOrdering first null
Re: EOSortOrdering first null
- Subject: Re: EOSortOrdering first null
- From: Maik Musall <email@hidden>
- Date: Thu, 19 Jul 2012 08:39:55 +0200
Approach 2: This will make 1 db call, uses less memory. It's quite simple and easy to understand. The whole idea is to push the nulls at the end with minimum instructions.
It uses less memory, but still does the null filtering in Java. I think the question was how to delegate that task to the database. Enumeration<MyTable> e = objects.objectEnumerator(); while(e.hasMoreElements()) { object = e.nextElement();
Java side note: if you can't use a Java 5 foreach loop and still have to use Enumeration, you can at least do it in a for loop so that the reference to the Enumeration object is contained inside the loop: for( Enumeration<MyTable> e = objects.objectEnumerator(); e.hasMoreElements(); ) { object = e.nextElement(); }
In regard to the original question: I'm not sure what you're up to, Grégoire. If you just don't want to deal with the null columns, include that in the fetchspec:
new EOKeyValueQualifier( key, EOQualifier.QualifierOperatorNotEqual, NSKeyValueCoding.NullValue );
That's plain WO. Perhaps there's even a shorter way using some Wonder stuff I don't know about yet.
Maik |
_______________________________________________
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