On 09/03/2013, at 8:11 AM, Paul Yu wrote:

> Greetings
> 
> I am trying to return a list of the primary keys of a toMany relationship on 
> an EO.
> 
> I've written a method on the EO to put the keys into NSMutableDictionaries 
> and added them an NSMutableArray.  I then return the array to my rest 
> controller.
> 
> This is NOT working as I would have expected.  What am I missing and is there 
> a video that I should watched?
> 
> Thanks
> 
> Paul
> ____


Hi Paul,

Maybe I'm not fully understanding your requirement, but can you not just create 
a custom filter in your 'owner' controller, say CompanyController:


public static ERXKeyFilter someRelationshipFilter(){

        ERXKeyFilter filter = ERXKeyFilter.filterWithNone();
        filter.include(Company.EMPLOYEES).include(Employee.PK_CUSTOM_KEY);
        return filter;
        
}


where a Company has many Employee objects, and in Employee.java:

public static final ERKKey<String> PK_CUSTOM_KEY = new 
ERKKey<String>("primaryKey");


Or is that barking up the wrong tree? Do you need the ids to be flattened in 
the response graph, or (in this case) the Employee element _not_ to be emitted?


I think you'd get the id attribute for free in the graph here anyway.


Cheers,

-- 
Matt.

http://logicsquad.net/


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to