-
1. Re: problem in ejbSelect
kryptontri Dec 6, 2001 8:23 AM (in response to julien1)should you not define your cmr relationships ? or have you ? jaws will not know what t. means ? have you defined your relationships like this [ taken from CMP docs : purchase online ]
<ejb-relation>
<ejb-relation-name>Order-LineItem</ejb-relation-name>
<ejb-relationship-role>
<!-- exdented to fit on a printed page -->
<ejb-relationship-role-name>order-has-lineitems</ejb-relationship-role-name>
One
<relationship-role-source>
<ejb-name>OrderEJB</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>lineItems</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<!-- exdented to fit on a printed page -->
<ejb-relationship-role-name>lineitem-belongsto-order</ejb-relationship-role-name>
Many
<cascade-delete/>
<relationship-role-source>
<ejb-name>LineItemEJB</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>order</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
</ejb-relation>
??
what about your foreign key mapping ?
<ejb-relation>
<ejb-relation-name>Order-LineItem</ejb-relation-name>
<foreign-key-mapping>
<ejb-relationship-role>
<!-- exdented to fit on a printed page -->
<ejb-relationship-role-name>order-has-lineitems</ejb-relationship-role-name>
<foreign-key-fields/>
</ejb-relationship-role>
<ejb-relationship-role>
<!-- exdented to fit on a printed page -->
<ejb-relationship-role-name>lineitem-belongsto-order</ejb-relationship-role-name>
<foreign-key-fields>
<foreign-key-field>
<field-name>ordernumber</field-name>
<column-name>ORDER_NUMBER</column-name>
</foreign-key-field>
</foreign-key-fields>
</ejb-relationship-role>
</foreign-key-mapping>
</ejb-relation>
Does this make sense to you ? I have not done cmp2.0 yet i will in a few weeks time. I hope this helps ? -
2. Re: problem in ejbSelect
julien1 Dec 6, 2001 9:15 AM (in response to julien1)Of course I have declared the relation :
in the ejb-jar :
<ejb-relation>
<ejb-relation-name>BagBean-TaskBean</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>BagBean-has-TaskBean</ejb-relationship-role-name>
Many
<relationship-role-source>
<ejb-name>BagBean</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>task</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>TaskBean-has-BagBeanCollection</ejb-relationship-role-name>
One
<relationship-role-source>
<ejb-name>TaskBean</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>bags</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
</ejb-relation>
in the jbosscmp-jdbc.jar :
<ejb-relation>
<ejb-relation-name>BagBean-TaskBean</ejb-relation-name>
<foreign-key-mapping>
<ejb-relationship-role>
<ejb-relationship-role-name>BagBean-has-TaskBean</ejb-relationship-role-name>
<fk-constraint>false</fk-constraint>
<foreign-key-fields>
<foreign-key-field>
<field-name>iD</field-name>
<column-name>TASK_ID</column-name>
</foreign-key-field>
</foreign-key-fields>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>TaskBean-has-BagBeanCollection</ejb-relationship-role-name>
<fk-constraint>false</fk-constraint>
<foreign-key-fields/>
</ejb-relationship-role>
</foreign-key-mapping>
</ejb-relation> -
3. Re: problem in ejbSelect
dsundstrom Dec 6, 2001 4:39 PM (in response to julien1)This is a bug in the EJB-QL parser. It was discovered and fixed after the alpha was released. The fix is in cvs.
-
4. Re: problem in ejbSelect
julien1 Dec 7, 2001 4:48 AM (in response to julien1)I tried cvs yesterday but I had a problem :
DataSources weren't bound into JNDI, so I had to use jboss3.0 alpha again.
is this normal ? maybe there is a feature that I have not activated at build time -
5. Re: problem in ejbSelect
julien1 Dec 7, 2001 5:54 PM (in response to julien1)I have posted a test case on sourceforge as a bug.
Please keep me informed with the issue as I am very interested by using this kind of ejbSelect
best regards Julien -
6. Re: problem in ejbSelect
bongosdude Jan 27, 2003 5:58 PM (in response to julien1)I am using Jboss 3.0.4 and I got this bug too. Can someone show me how to get the patch from pvcs. What files do I need to download.
Thanks -
7. Re: problem in ejbSelect
triathlon98 Jan 28, 2003 10:43 AM (in response to julien1)Why are you creating a ejbSelect method?
Have a good look at the CMP documentation which can be bought online. You are trying to query a relationship, so make sure you define it as bidirectional and just expost a "abstract Collection getBags()" method in your Task. Everything should work automagically.
Joachim