Hi,

I am trying to model a ContactMechanism entity with three specialized
entities representing Phone, Email and PostalAddress. I followed the
ERPartial documentation and example and thought that I would be able to
model composition instead of inheritance using ERPartials. Since the three
specialized entities are very different from each other, each one has its
own table.

I created the ContactMechanism and Phone entities, Phone being a partial
entity of ContactMechanism. I then added a one to many relationship from
Phone to Party, so that a Party has many Phones.

The generated SQL doesn't create a join or consider the two tables,
ContactMechanism and Phone, and gives an obvious exception with the
following generated SQL:

EvaluateExpression failed:
<com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression: "SELECT
t0.areaCode, t0.contactMechanismTypeID, t0.countryCode, t0.created,
t0.extension, t0.id, t0.isMain, t0.lastModified,
t0.nonSolicitationIndication, RTRIM(t0.number), t0.partyID FROM
ContactMechanism t0 WHERE t0.partyID = ?" withBindings: 1:9(partyID)>: Next
exception:SQL State:42S22 -- error code: 1054 -- msg: Unknown column
't0.areaCode' in 'field list'

This SQL is generated for the phones relationship from Party.

It seems that I didn't grasp how to use partials. Any suggestions or should
I rely on inheritance instead?

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

This email sent to [email protected]

Reply via email to