OK, I ended up doing what Anjo suggested (with Dave's help) and modified our entity template to look for a user info tag and if it exists, use that as the super class. I removed the abstract entity from the model and just provided that path to the one I previously had modeled and generated in the user info dictionary with the appropriate key so the template would see it.

Seems to work, and my abstract superclass contains what I needed without re-writing the code many times.

Thanks to everyone who helped!

Andrew


On Aug 7, 2009, at 1:46 AM, [email protected] wrote:

Date: Thu, 06 Aug 2009 16:10:39 -0400
From: "Andrew R. Kinnie" <[email protected]>
Subject: Multiple EO classes inheriting from one abstract superclass?
To: WebObjects-Dev List <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes

Greetings:

I have four tables in a database, which are materialized views from an
oracle db.  All four share 12 columns, which are basically numerical
values.

I have 4 components which display repetitions based on these four
tables.  I have these inheriting from one abstract superclass
containing the calculations on the 12 values.

It seemed to me logical, and very object oriented to have these 4 eo
tables inherit from 1 abstract superclass containing the 12 shared
attributes.

I modeled this and checked the "Abstract" checkbox in Entity Modeler.
I did not select a source table as this class is supposed to be
abstract.

The problem is, Entity Modeler wants me to have a primary key for the
abstract eo superclass, but the 4 subclasses have different primary
keys representing different foreign keys from their source tables.
Some of these keys are multiple foreign keys from multiple source
tables (i.e. the eo is essentially a join)

If I let Entity Modeler set a primary key of "id" and delete the
inherited "id" primary keys from the subclasses (leaving the
previously existing primary keys, just pointing the subclass eos to
the new superclass), I get an SQL error because the tables are missing
an id column.

Any ideas?  It there a way to do this?  Or do I need to write the code
4 times in both the component and the eos?

Thanks in advance.

Andrew Kinnie

WOLips 5888
Wonder 8988
WO 5.4.3
Mac OS X 10.5.7

 _______________________________________________
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