Am 06.02.2008 um 21:33 schrieb James Cicenia:
Well I have decided to to start going to 1.5 now. this is something I do all the time: NSMutableArray args2 = new NSMutableArray(); args2.addObject("portfolio"); args2.addObject(portfolio);myQualifier2 = EOQualifier.qualifierWithQualifierFormat("%@ = %@", args2);NSArray results = EOQualifier .filteredArrayWithQualifier(portfolioUserGroups(),myQualifier2);How do I make that "generic Java 1.5" friendly?
a generic friendly version would be:
NSMutableArray<Object> args2 = new NSMutableArray<Object>();
args2.addObject("portfolio");
args2.addObject(portfolio);
EOQualifier myQualifier2 =
EOQualifier.qualifierWithQualifierFormat("%@ = %@", args2);
NSArray<EOGenericRecord> results =
(NSArray
<
EOGenericRecord
>
)EOQualifier
.filteredArrayWithQualifier(portfolioUserGroups(),myQualifier2);
The mutable array uses Object as type so you can intermix diffent kinds of types as in your example. The results array will consist of one single type of entities so you should set it to whatever entity type you expect (I used EOGenericRecord as superclass as I don't know of what type the result should be). If you are using WO prior to 5.4 you have to typecast the return value of filteredArrayWithQualifier because genericised (?) functions appeared only in 5.4.
jw
Thanks, James Cicenia _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/werner%40isd.uni-stuttgart.de This email sent to [EMAIL PROTECTED]
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
