Thanks Pascal,

Unfortunately still no luck. If I add in an id field I get:

IllegalStateException: The object with globalID _EOIntegralKeyGlobalID[EntityA 
(java.lang.Integer)0] could not be found in the database. This could be result 
of a referential integrity problem with the database. An empty fault could not 
be created because the object's class could not be determined (e.g. the GID is 
temporary or it is for an abstract entity).

Which, I'm sure means that it is not looking at the 'type' field to get the 
entityDescription. Is there somewhere that I need to register the entity name 
or that the relationship is to an abstract entity? Do I need to turn on the 
lookup 'entity name by type' behavior?

Cheers,
Charles



Charles Young
NEURAL GLUE

503.360.3178
[email protected]
neuralglue.com

On Feb 10, 2012, at 1:27 AM, Pascal Robert wrote:

> 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