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 protected]
> neuralglue.com
> 
> _______________________________________________
> 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/probert%40macti.ca
> 
> This email sent to [email protected]


 _______________________________________________
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