> I am playing with the current sources and testing a 1 to many
> relationship. I have the following two tables
>
> order  with pk: int objectid

ok

> and
> orderdetail
> pk: int order_oid,int line_num

Does order detail have a compund key using both order_oid and line_num?

> The link..
> order_oid=objectid

Ok, foriegn-key style mapping.

> There is a 1 to many relationship between Order and orderdetail. When
> you go to access the collection it tries to look up the orderdetail
> lines with order_oid_objectid.

Yep, that is the auto generated foreign key name.

> In
org/jboss/ejb/plugins/cmp/jdbc/metadata/JDBCRelationshipRoleMetaData.java
> it always appends the the other side of the relationships field to the
> query fieldname.

The goal is to generate a unique field name.

> This does not seem right, if there is another field
> name that is the forgien key then I should specify it otherwise it
> should default to the selected field.

What do you mean by selected field?

> I guess you would run into
> problems if the key was a composite and you had to match the two up.
> Flips through the spec .... Nope the spec only alllows for 1 field to be
> the forgein key

What spec?  If the parent table has a compound key or a single key field
that maps to multiple columns (dependent value class), you will need
multiple foreign key fields.

> As aside I can see the next problem coming. Really this collection
> should be loaded ordered by line_num but there is no way to specify this
> in the EJB 2.0 spec. (order is not defined) Maybe something for
> jbosscmp-jdbc.xml?

Ordering is another issue. I will be working this later.

-dain


_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to