db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bart Molenkamp" <b.molenk...@bizzdesign.nl>
Subject Non-decomposed m:n mappings sharing foreign key fields
Date Wed, 25 May 2005 08:16:29 GMT
Hi all,

I have a problem with m:n mappings. I have a type ProcessImpl, and a
type AccountImpl, and between them there is an m:n relationship. Both
types are children of a type FrameworkImpl. Relations between
ProcessImpl objects and AccountImpl objects are only allowed within the
same FrameworkImpl object (thus they must have the same FrameworkImpl
parent). Therefore, I want to share the FRAMEWORK_ID field in the
indirection table. See the OJB doclet snippet from AccountImpl below:

@ojb.collection element-class-ref="...ProcessImpl"

There is a similair snippet for ProcessImpl, of course.

When I try to create a ProcessImpl and an AccountImpl, and add a
relation between them, the process fails because OJB tries to update the
indirection table where it puts the field FRAMEWORK_ID two times in a
single query (one time for the ProcessImpl reference, one time for the
AccountImpl reference) and this is not allowed by the database.

Is this a bug, or am I doing something wrong here? I think I can fix the
problem by doing the decomposition manually, but I rather let OJB do it
transparently as I don't have to change my domain model then.

Thanks in advance,

To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org

View raw message