• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: REST Relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: REST Relationship


  • Subject: Re: REST Relationship
  • From: Pascal Robert <email@hidden>
  • Date: Thu, 20 Dec 2012 12:51:39 -0500

Le 2012-12-20 à 10:03, gabor raz <email@hidden> 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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >REST Relationship (From: gabor raz <email@hidden>)

  • Prev by Date: Re: ERXRoute question
  • Next by Date: Re: SWIG framework in a WebObjects Application
  • Previous by thread: Re: REST Relationship
  • Next by thread: time selection
  • Index(es):
    • Date
    • Thread