Hi all,

I'm trying to map a hierarchy into multiple joined tables. I know ojb doesn't support this directly, but I can't do it the way the documentation suggests me to do.

I have 5 tables: client, clientVersion, clientHomeOfficeVersion, clientEnterpriseVersion and clientSmallOfficeVersion.

A client has a collection of clientVersions. The clientVersion table has the common data, and the 3 other versions have the specific data for each version. The primary key of each of those tables is a foreign key to the primary key of the clientVersion table (i. e., they're weak entities).

My question is, how can I have a collection of clientVersions, regardless of their specific type?

I've looked into it and found the following alternatives, both uninviting in their inelegance:

1) Connect the clientVersion and the specific type with a 1:n mapping. (1 clientVersion to n specific versions). That way I can make use of the reverse-foreignkey tag and maintain referential integrity.

2) Connect the clientVersion and the specific type with a 1:1 mapping. Unfortunately, I'll lose referential integrity if I do this.

If I'm desperate, I'll opt for the first alternative, but I still hope that there is a better way to do this.

I would be grateful if someone could shed some light on this.

Cheers,

David


--
To unsubscribe, e-mail: <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>

Reply via email to