I'm not quite able to figure out the syntax for orion-ejb-jar to map a 
dependent object list to its own table in a cmp entity.  I've read the 
object/relational documentation carefully :-), but I haven't been able 
to find the answer.  

Assume an EJB with a primary key field: key1.  Assume further a 
dependent object with three fields: depKey, field2, and field3.  The 
primary key for the dependent table should be key1 (a migrated 
key) plus depKey.

The closest I can get is something like the following, which gives a 
correct mapping but incorrectly makes the primary key consist 
solely of key1 (I've tried a lot of other permutations):

<cmp-field-mapping name="listRelatedData">
        <list-mapping table="RelatedData">
                <primkey-mapping>
                        <cmp-field-mapping>
                                <fields>
                                        <cmp-field-mapping name="key1" persistence-
name="key1" />
                                </fields>
                        </cmp-field-mapping>
                </primkey-mapping>
                <value-mapping type="test.DependentObject">
                        <cmp-field-mapping name="value">
                                <fields>
                                        <cmp-field-mapping name="depKey" 
persistence-name="depKey" />
                                        <cmp-field-mapping name="field2" persistence-
name="field2" />
                                        <cmp-field-mapping name="field3" persistence-
name="field3" />
                                </fields>
                        </cmp-field-mapping>
                </value-mapping>
        </list-mapping>
</cmp-field-mapping>

Thanks for any help,

Dan


Reply via email to