Inheritance problem in EOModeler
Inheritance problem in EOModeler
- Subject: Inheritance problem in EOModeler
- From: "Marc Desjardins" <email@hidden>
- Date: Mon, 23 Feb 2004 15:58:45 -0500
Hi everybody,
I have a problem with Inheritance in EOModeler, I'll try to be clear. I'm
building a WebObject Application for a client, it uses a framework that
contains all our data persitence objects. The data framework, in turn, uses
a framework provided by the client that contain their basic data structure.
I've simplified the structure for the sake of this example, but here's
basically what I'm doing. The client framework contains a User table. In our
data framework, we are extending their user object to add more fields and
relationships with our items.
So for this example, let's called their framework clientFW. It contains one
table called User with the following fields:
ID, PK, int
FirstName, varchar
LastName, varchar
In our framework, let's call it DataFW, we have a ExtendedUser object. To
build it, in EOModeler, I created the object, I've set the Parent as User
(from the clientFW framework). I've copied the fields: ID, FirstName,
LastName, added our own fields and I've added a relationship to User.
So we have ExtendedUser which has a parent of type User
It has a primaryKey:
ID, int
it has the following fields derived
FirstName -> User.FirstName
LastName -> User.LastName
and the new field
Username, varchar
and it also has a relationship
User, the source is ExtendedUser.ID and the destination is User.ID
When I try to save the EOModeler, it gives me the error:
Entity ExtendedUser has some primaryKeyAttributes that don't match the
primaryKeyAttributes of its parent entity User. ( ExtendedUser.ID User.ID)
The ExtendedUser and the User table are in two different openbase database,
I'm not sure if this can create a problem. We thought we could do it like
that since the client already has it's own database and we didn't want to
mix their tables and our tables.
When I try to run the application, I get the following error:
Error:
com.webobjects.jdbcadaptor.JDBCAdaptorException: EvaluateExpression failed:
: Next exception:SQL State:42000 -- error code: 0 -- msg: SQL ERROR -
[position 236, near 'WHERE' in ' USER T1 WHERE t0.ID'] (1) table 'USER' does
not exist. SQL: SELECT T1.FIRSTNAME, T1.LASTNAME, t0.USERNAME, t0.ID FROM
EXTENDED_USER t0, USER T1 WHERE t0.ID = T1.ID
Reason: EvaluateExpression failed:
<com.webobjects.jdbcadaptor.OpenBasePlugIn$OpenBaseExpression: "SELECT
T1.FIRSTNAME, T1.LASTNAME, t0.USERNAME, t0.ID FROM EXTENDED_USER t0, USER T1
WHERE t0.ID = T1.ID">: Next exception:SQL State:42000 -- error code: 0 --
msg: SQL ERROR - [position 236, near 'WHERE' in ' USER T1 WHERE t0.ID'] (1)
table 'USAGER' does not exist. SQL: SELECT T1.FIRSTNAME, T1.LASTNAME,
t0.USERNAME, t0.ID FROM EXTENDED_USER t0, USER T1 WHERE t0.ID = T1.ID
Any ideas what I'm doing wrong? If you need more info, please let me know.
We are using WebObjects 5.22 on Windows 2000.
Thanks
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.