On 5/2/05, Ronald Rudy <[EMAIL PROTECTED]> wrote:
> Here is my mapping:
>
> <class name="com.xyz.ObjectOne" identity="oneId"
> key-generator="SEQUENCE">
> <description>"First of Many-to-Many Object"</description>
> <map-to table="object_one"/>
> <cache-type type="none"/>
> <field name="oneId" type="integer">
> <sql name="object_one_id" type="integer"/>
> </field>
>
> ...
>
> <field name="objectTwo" type="com.xyz.ObjectTwo"
> collection="arraylist">
> <sql name="object_two_id" many-table="objectone_objecttwo_map"
> many-key="object_one_id" key-generator="SEQUENCE" />
> </field>
Ronald,
The repsonse in another thread provided by Emir is correct insomuch as
mapping the bi-directional relationship between the two objects and
marking certain fields as lazy loaded. In addition to that, Castor
only supports the key-generator attribute on the class element.
Placing a key-generator attribute on the sql element as above will
have no effect as it is not supported. In order to get around this, in
the past, I've modeled the bridge table as a Java object and persisted
it along with the rest of the object model. Doing this will allow the
key-generator to be specified on that object so that a key will be
created for the table.
Bruce
--
perl -e 'print unpack("u30","D0G)[EMAIL
PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
The Castor Project
http://www.castor.org/
Apache Geronimo
http://geronimo.apache.org/