Le 2012-12-20 à 10:03, gabor raz <[email protected]> a écrit :

> Hi,
> 
> 
> I try to create a REST interface for a application. And my problem know is i 
> don't  understand how to set relationships.
> I tried it like in the ERRestRouteExample with the updateAction.
> 
>                               ERXKeyFilter filter = 
> ERXKeyFilter.filterWithAttributes();
>               filter.include( AppointmentRequest.TO_DECLINE_REASON );
> 
>               AppointmentRequest request = appointmentRequest();
>               update( request, filter );
>               editingContext().saveChanges();
>               
>               return response( request, filter );
> 
> My JSON data look like this.
>                                       { toDeclineReason:{ oid: 2 } }
> 
> But now I got the message back that I have to  provide the "Display Name" 
> which is a attribute of the entity DeclineReason.
> Is there another way to set the relationships?

Either use ERXKeyFilter.filterWithAttributesAndToOneRelationships() if you want 
all attributes of DeclineReason (if it's a 1:1 relationship), or:

ERXKeyFilter filter = ERXKeyFilter.filterWithAttributes();
filter.include(AppointmentRequest.DECLINEREASON.dot(DeclineReason.DISPLAY_NAME));


 _______________________________________________
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