Re: Strange error message

Anjo Krank <[email protected]>
Newsgroups gmane.comp.web.webobjects.eof
Message-ID <[email protected]>
Hi Pierre,

thanks again for being so helpful on this topic!
>> thanks for the exhaustive note. I'm still not sure why this wouldn't
>> affect to-many relationships or how to work around this in a more
>> general fashion.
>
> to-many relationships could be affected the same way. I used the 
> to-one relationship mainly as an example.

OK.

>> I'm not sure what you mean: if I don't model the inheritance, would I
>> include Vehicle in my model? If I don't, then how could I have a
>> relationship to it? You don't happen to have a working example handy 
>> ?-)
>
> That's the advantage of not having the Vehicle entity in the EOModel. 
> You should not have relationships pointing to it.

OK.

> Having it outside the model eliminates all risks to create such a 
> relationship later on in the project's lifetime. You may not call a 
> fetch specification on the root entity if primary keys are not unique 
> on the children.

So basically if I *need* such a relationship - for sinister purposes of 
my own - then the simplest way would be to split it up into multiple 
relationship (toCars,toBicylces) and join them together manually to a 
toVehicles? This would at least work for fetching things, if not for 
adding new ones. Those must be added to the specialized relationships.

> I do have examples where the root enity is not declared in the 
> EOModel. However I don't see how I could strip them down to a point to 
> become helpful examples.

You have done more than enough already. Thanks anyway!

> There is nothing magic about having inheritance outside the EOModel.

Yes, I've already done that.

> You simply need to manually create the root class as subclass of 
> EOGenericRecord. In that root class you define methods common to all 
> subclasses as abstract method. Your subclasses only need to inherit 
> from that class rather than from EOGenericRecord. With appropriate 
> templates and Makefile entries you can easily set this up with 
> EOGenerator.

Sure, I'm still pretty miffed why there is no simpler (read: less code, 
more general) solution to this...

Cheers, Anjo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.