Re: Inheritance and ERRest
Re: Inheritance and ERRest
- Subject: Re: Inheritance and ERRest
- From: Pascal Robert <email@hidden>
- Date: Fri, 10 Feb 2012 04:27:39 -0500
By passing the 'type' argument, it should work automatically. But I see that you don't pass any 'id' (primary keys) for Entity C and Entity B, if you wish to use existing Entity C and B objects when you create a Entity Z object, you need to pass the id.
> Hi,
>
> I have a hierarchy of objects using horizontal inheritance:
>
> Entity A is Abstract
> - ordinal
> - type
>
> Entity B : has Parent Entity A
> - rating
>
> Entity C : has Parent Entity A
> - text
>
> I also have an Entity Z that has a to-many relationship "contents" with Entity A
>
> My question is:
>
> I want to create an instance of Entity Z that has several Entity Bs and Entity Cs. How do I let ERRest know which classDescription to use?
>
> For example with JSON string like:
>
> {
> "nameText":"An Interesting Name",
> "type":"Entity Z",
> "contents":
> [{
> "ordinal":"1",
> "text":"This is some text content",
> "type":"Entity C"
> }],
> [{
> "ordinal":"6",
> "rating":"1.5",
> "type":"Entity B"
> }]
> }
>
> Is there a way of extracting the 'type' so that ERRest will use the correct classDescription when creating and updating entities?
>
> Thanks
>
> Charles
>
>
> Charles Young
> NEURAL GLUE
>
> 503.360.3178
> email@hidden
> neuralglue.com
>
> _______________________________________________
> 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
_______________________________________________
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