Simple Horizontal Inheritance Problem

"Ashley Aitken" <[email protected]> Fri, 02 Apr 2004 00:03:27 +0800
Newsgroups gmane.comp.web.webobjects.eof
Message-ID <[email protected]>
Howdy All,

I am trying out horizontal inheritance in the simplest of application
(simple EOModel + DirectToWeb).

The EOModel contains an abstract entity (AbstractUser) without a table
and marked abstract in the EOModel, and two concrete entities (Client
and Employee) that have their parent set to be AbstractUser.

All entities are using EOGenericRecord class (for now).  The
AbstractUser entity has a primary key and one other simple attribute.
The other entities inherit those attributes and add a simple attribute
of their own.

So both of the tables are using the definition of the primary key in
AbstractUser as their primary key (this may be confusing MySQL).

When I run it with MySQL it allows me to create one of each object, but
then thinks it has two of the same type of object (if you know what I
mean), and when I try to create a third object, it throws an exception
about trying to use the same primary key value twice (or thereabouts).  

When I run the same application (slightly modified EOModel for the
different database) with OpenBase, it won't even let me save an object. 
It throws an exception saying that the primary key cannot be null, EOF
seems to be ignoring the primary key for each table when generating the
SQL.

And, on another point, I can't seem to get FrontBase to work anymore. 
3.x would connect fine from EOModeller but fail trying to connect with
the running application (seems like the JDBC driver used by the running
app was not working).  Reinstalled it, but still not work.

Upgraded to 4.x and now even EOModeller can't find an appropriate JDBC
driver ... but that's another problem, I guess.

Any pointers on Horizontal Inheritance, with or without MySQL would be
appreciated.

I've tried to follow Apple's directions in the EOModeller book.

Thanks in advance,
Ashley Aitken.

PS MacOSX 10.3 with WO5.2.3 and MySQL, FrontBase, OpenBase ...