----- Original Message -----
From: "Jeff Schnitzer" <[EMAIL PROTECTED]>
To: "Orion-Interest" <[EMAIL PROTECTED]>
Sent: Monday, January 08, 2001 4:43 PM
Subject: RE: Complex O/R and EJB 2.0 CMP
* SNIP *
> Take a look at the documentation for orion-ejb-jar.xml; there is a lot
> you (supposedly) can do that is not yet supported by EJB2.0 (like Map
> and List types).
Speaking of Lists, has anyone at all managed to get an Orion list-mapping -
whether declared in a EAR-contained orion-ejb-jar.xml or in a EJB2.0-style
ejb-jar.xml - to actually preserve the element order?
Furthermore, has anyone figured out how to prevent Orion's auto-creation of
database tables from creating a database primary key on the list-mapping
table that prevents there ever being more than one element in the list? This
happens with both Orion (1.4.0 & 1.4.4) whenever the parent entity EJB has a
custom primary key class - Orion adds the EJB primary key fields to the
list-mapping database table and then creates a database table primary key to
match these EJB primary key fields. Naturally, trying to add a second list
element to any instance of the parent EJB means adding another row to this
table with identical primary key values to an existing row. Voilà, instant
SqlException from the primary key unique index violation.
We've resorted to using an extra field in the DO to indicate its index in
the list, and doing the sorting programmatically in the parent EJB's List
field accessor method. Having to drop the auto-created table and use our own
DDL is somewhat less onerous a work-around, but it really shouldn't be
necessary IMO.
Is there some secret incantation we're not aware of (one of many I'm sure)
or is Orion's list-mapping really just a buggy collection-mapping by another
name?
P. Pontbriand
Canlink Interactive Technologies Inc.