Resend - it didn't post the first
time:----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------

Hello -
For the hell of it I decided to test M-N relationships in the latest release of Orion 
(1.5.4). I
started by trying to work with some of Monson-Haefel's examples - the result was the 
same as that
below. To simplify it, I just created a couple of test entities, each with a 
collection based
reference to the other entity. Using local interfaces. The 1-N relationships seem to 
work just
fine. I am wondering if I am missing something in the M-N relationship construction.

otest1Local:
// Collection ref to otest2
public Collection getOtest2s( );
public void setOtest2s(Collection otest2s);

otest1EJB:

// abstract methods
public abstract Collection getOtest2s( );
public abstract void setOtest2s(Collection otest2s);

There is a similar setup for the other entity. The relationship references are (from 
ejb-jar.xml):


<relationships>
<ejb-relation>
  <ejb-relation-name>otest1-otest2</ejb-relation-name>
  <ejb-relationship-role>
     <ejb-relationship-role-name>
       otest1-has-many-otest2
   </ejb-relationship-role-name>
  <multiplicity>Many</multiplicity>
  <relationship-role-source>
    <ejb-name>otest1</ejb-name>
  </relationship-role-source>
  <cmr-field>
  <cmr-field-name>otest2s</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
  </cmr-field>
</ejb-relationship-role>

<ejb-relationship-role>
  <ejb-relationship-role-name>
  otest2-has-many-otest1
  </ejb-relationship-role-name>
  <multiplicity>Many</multiplicity>
  <relationship-role-source>
    <ejb-name>otest2</ejb-name>
  </relationship-role-source>
  <cmr-field>
   <cmr-field-name>otest1s</cmr-field-name>
  <cmr-field-type>java.util.Collection</cmr-field-type>
  </cmr-field>
  </ejb-relationship-role>
 </ejb-relation>
</relationships>



As I said earlier, the faithful 1-many relationships work. When changed to an m-n 
relationship, as
the entity jar is being deployed it comes back with the following:


Auto-deploying testorion (New server version detected)...
Auto-deploying server.jar (No previous deployment found)... java.lang.NullPointe
rException
at com.evermind._eh._hg(.:120)
at com.evermind._eh._de(.:173)
at com.evermind._ef._de(.:292)
at com.evermind._em._nvc(.:395)
at com.evermind._eq.<init>(.:63)
at com.evermind._ed._aa(.:186)
at com.evermind._ai._kmd(.:526)
at com.evermind._aj._kmd(.:287)
at com.evermind._aj._vxb(.:119)
at com.evermind.server.ApplicationServer._sxc(.:1308)
at com.evermind.server.ApplicationServer._ige(.:1265)
at com.evermind.server.ApplicationServer._vxb(.:1003)
at com.evermind._cxb.run(.:89)
at java.lang.Thread.run(Thread.java:536)
at com.evermind._bt.run(.:47)


=====================================
and then doesn't deploy of course. Before I submit a bug for this - did I miss 
something somewhere
or is this legit?

Cheers!
Ray

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

Reply via email to