On Oct 31, 2008, at 11:26 PM, Lachlan Deck wrote:

On 01/11/2008, at 5:04 PM, Paul Hoadley wrote:

On 01/11/2008, at 3:29 PM, Lachlan Deck wrote:

On 01/11/2008, at 3:39 PM, Paul Hoadley wrote:

After finding "Subclass Entity" in Entity Modeler, and re-making the child entity specifying horizontal inheritance, this question remains:

On 01/11/2008, at 11:19 AM, Paul Hoadley wrote:

2. Practical WebObjects (p. 32) states that horizontal inheritance "puts a complete copy of each entity into a separate table". Does EOF do this for me? That is, if I use _AMPerson.createAMPerson(), does EOF put a row in the 'amperson' table, and a corresponding row in the 'person' table?

I've just used _AMPerson.createAMPerson() to create a new AMPerson. There's a new row in 'amperson', and nothing in 'person'. Have I misunderstood "complete copy" here? That is, should there be a corresponding new row in 'person', or not?

Which documentation were you reading? Horizontal inheritance is what you said you want ... but that's not matching your expectations.

The mismatch was because I think I took "complete copy" (in Practical WebObjects) to mean a complete copy of an inserted row rather than the columns from parent to child table. (And the confusion before that was because I hadn't discovered the "Subclass Entity" button in Entity Modeler.)

Brief summary of inheritance types is as follows:

Thanks.

For both VI and STI you usually define a column in the parent (e.g., called entityType) that's populated on awakeFromInsertion with e.g., if (entityType() == null) setEntityType(entityName()); In the model you then in each child entity set the definition for the restricting qualifier to e.g., (entityType like 'EntityName').

Thanks---I wasn't sure how to do this, which is why I chose HI in the first place.

No worries. Though inheritance can be quite useful (and seems like the sensible decision) it's not easy to back out of it later on esp with STI and VI.

STI, as Chuck mentioned, is the path most travelled. VI is the path less trodden, so beware of going down this path unless you're prepared to get your hands dirty with some of EOFs bugs (I'm slowly trying to get em fixed though - just need to work up some test cases to match my patches).

And also only use VI if you are primarily fetching leaf entities. Otherwise you may not like the performance impact.

Chuck


--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to