I have put quite an effort into making the CMP 2.0 features work, using both
Orion 1.4.5 and 1.4.7 out of the box. I have narrowed my problem down to
this:

I have several uni-directional relationships, both 1:N and 1:1 and they seem
to work just fine. For instance, when I create a new ejb A which knows
another ejb B through a 1:1 relationship Orion stores ejb A along with the
foreign key from ejb B. Yabbadabbadoo! However, my excitement comes to an
end after I restart Orion. When I call A.getB() i get a null. - Orion does
not use the key of B stored in A to raise an ejb of type B for me.

Below is my ejb-relation definition - any hints would be G R A T E L Y
appreciated.
Thanks

Randahl


  <ejb-relation>
   <!-- this is the unidirectional relationship from many A to one B -->

   <ejb-relation-name>A-B</ejb-relation-name>
   <ejb-relationship-role>
    <ejb-relationship-role-name>a-has-b</ejb-relationship-role-name>
    <multiplicity>Many</multiplicity> <!-- NOTE: I have tried both One and
Many here -->
    <role-source>
     <ejb-name>AEJB</ejb-name>
    </role-source>
    <cmr-field>
     <cmr-field-name>b</cmr-field-name>
    </cmr-field>
   </ejb-relationship-role>
   <ejb-relationship-role>
    <ejb-relationship-role-name>b-belongsto-a</ejb-relationship-role-name>
    <multiplicity>One</multiplicity>
    <role-source>
     <ejb-name>BEJB</ejb-name>
    </role-source>
    <!-- no cmr fields; unidirectional relationship -->
   </ejb-relationship-role>
  </ejb-relation>

My ejb A is specified as

<entity>
        <cmp-version>2.0</cmp-version>
        <ejb-name>A</ejb-name>
(...)
        <persistence-type>Container</persistence-type>
(...)
        <cmp-field><field-name>b</field-name></cmp-field>
(...)
</entity>


NOTE: I know "b" should not be mentioned here according to the specification
because it is a cmr-field. I have put it here because Jim Archers example
mentiones the need to do so on Orion. I have verified that if I don't, I get
a deployment error (saying that getB() and setB() cannot be abstract methods
for Orion to implement).


Reply via email to