-
1. Re: incomplete jbosscmp-jdbc.xml generated using xdoclet+jbo
pablojavierpy Oct 19, 2004 11:31 AM (in response to sudhir_suman)This example works for me with same configuration:
/**
* @ejb.relation
* name = "Party-PartyTaxInformation"
* role-name="Party-has-PartyTaxInformations"
* target-ejb="PartyTaxInformationEJB"
* target-role-name = "PartyTaxInformation-of-Party"
* target-cascade-delete = "yes"
* target-multiple = "no"
* @jboss.target-relation
* related-pk-field = "partyId"
* fk-column = "partyId"
* fk-constraint = "true"
*
* @ejb.interface-method view-type = "local"
*/
public abstract Collection getPartyTaxInformations();
/**
*
* @ejb.interface-method view-type = "local"
*/
public abstract void setPartyTaxInformations(Collection partyTaxInformations);
Hope this helps. -
2. Re: incomplete jbosscmp-jdbc.xml generated using xdoclet+jbo
sudhir_suman Oct 19, 2004 11:38 AM (in response to sudhir_suman)Hi,
in your example, target-multiple="no" and u are requesting for collection of TaxInformations? are u implementing 1:1 or 1:m relation here?
can u send/post me your build scrpt where u generate this?
thanks
Sudhir
here is mine.
<!-- Comment the next two lines, if you do not want to e
xpose the Beans via the Remote Interface --> -
3. Re: incomplete jbosscmp-jdbc.xml generated using xdoclet+jbo
sudhir_suman Oct 19, 2004 11:41 AM (in response to sudhir_suman)One more question,
is "partyId" defined as key in "PartyTaxInformationEJB" ?
thanks -
4. Re: incomplete jbosscmp-jdbc.xml generated using xdoclet+jbo
pablojavierpy Oct 19, 2004 12:57 PM (in response to sudhir_suman)Yes, I am implementing 1:m relationships. Do you think the tag is wrong?
What does ejb-jar.xml says about your <primkey-field> tag? Is it set correctly? Error you are getting seems to be caused by a wrong primary key setting. Am I right?
No, partyTaxInformationId is defined as key in PartyTaxInformationEJB:
Check the ejb-jar.xml
<![CDATA[Party Tax Information]]>
<display-name>PartyTaxInformation EJB</display-name>
<ejb-name>PartyTaxInformationEJB</ejb-name>
<local-home>py.com.roshka.wops4.party.taxInformation.interfaces.PartyTaxInformationEJBLocalHome</local-home>
py.com.roshka.wops4.party.taxInformation.interfaces.PartyTaxInformationEJBLocal
<ejb-class>py.com.roshka.wops4.party.taxInformation.ejb.PartyTaxInformationEJB</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
False
<cmp-version>2.x</cmp-version>
<abstract-schema-name>PartyTaxInformationEJB</abstract-schema-name>
<cmp-field >
<![CDATA[]]>
<field-name>partyTaxInformationId</field-name>
</cmp-field>
<cmp-field >
<![CDATA[]]>
<field-name>taxAuthority</field-name>
</cmp-field>
<cmp-field >
<![CDATA[]]>
<field-name>taxPercent</field-name>
</cmp-field>
<cmp-field >
<![CDATA[]]>
<field-name>taxRegistrationNumber</field-name>
</cmp-field>
<cmp-field >
<![CDATA[]]>
<field-name>typeOfTaxRegistration</field-name>
</cmp-field>
<primkey-field>partyTaxInformationId</primkey-field>
<query-method>
<method-name>findAll</method-name>
<method-params>
</method-params>
</query-method>
<ejb-ql><![CDATA[SELECT OBJECT(o) FROM PartyTaxInformationEJB o]]></ejb-ql>
<!-- Write a file named ejb-finders-PartyTaxInformationEJB.xml if you want to define extra finders. -->
-----------------------
Hope this helps. -
5. Re: incomplete jbosscmp-jdbc.xml generated using xdoclet+jbo
sudhir_suman Oct 19, 2004 12:57 PM (in response to sudhir_suman)thanks Pablo Javier Santa Cruz Cosp,
i used ur example and it worked. even with target-mutliple = "yes" -
6. Re: incomplete jbosscmp-jdbc.xml generated using xdoclet+jbo
pablojavierpy Oct 19, 2004 1:17 PM (in response to sudhir_suman)No prob. Have had your same problem!
Good luck. -
7. Re: incomplete jbosscmp-jdbc.xml generated using xdoclet+jbo
sudhir_suman Oct 19, 2004 2:51 PM (in response to sudhir_suman)hi Pablo,
have you used a bi-directional relationship in the same setup. i get deployment errors saying the key fields are not defined and i checked jbosscmp-jdbc.xml , they are not generated.
uni-directional works fine.
if u have an example, please reply
thanks -
8. Re: incomplete jbosscmp-jdbc.xml generated using xdoclet+jbo
pablojavierpy Oct 20, 2004 6:25 AM (in response to sudhir_suman)No. I haven't use bidirectional. If you are using bi-directionar, remember to remove "taget" doclet tags in both sides, and the relation-name must be equal in both sides.
If I have an example working, I will let you know.
Just wondering, what database engine are you using for persistence?