-
1. Re: foreign-key mapped relationship problem
h2o_polo Jan 6, 2003 9:13 AM (in response to craighamilton)can you post your Activity bean's descriptor from ejb-jar?
-
2. Re: foreign-key mapped relationship problem
craighamilton Jan 6, 2003 9:26 AM (in response to craighamilton)
<![CDATA[This is the Activity entity bean.]]>
<ejb-name>ActivityBean</ejb-name>
test.ActivityBeanHome
test.ActivityRemote
<local-home>test.ActivityBeanLocalHome</local-home>
test.ActivityLocal
<ejb-class>test.ActivityBeanCMP</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>ActivityBean</abstract-schema-name>
<cmp-field >
<![CDATA[Returns the ActivityID]]>
<field-name>activityID</field-name>
</cmp-field>
<cmp-field >
<![CDATA[Returns the Year]]>
<field-name>year</field-name>
</cmp-field>
<cmp-field >
<![CDATA[Returns the ID]]>
<field-name>recordID</field-name>
</cmp-field>
<cmp-field >
<![CDATA[Returns the Activity Description]]>
<field-name>description</field-name>
</cmp-field>
<cmp-field >
<![CDATA[Returns the Work Comments]]>
<field-name>workComments</field-name>
</cmp-field>
<cmp-field >
<![CDATA[Returns the Accomplishments in terms of number of accomplishments of the specified unit of measure]]>
<field-name>accomplishments</field-name>
</cmp-field>
<cmp-field >
<![CDATA[Returns the Unit of Measure]]>
<field-name>unitOfMeasure</field-name>
</cmp-field>
<!-- Write a file named ejb-finders-ActivityBean.xml if you want to define extra finders. -->
<!--
To add entity beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called entity-beans.xml that contains
the markup for those beans.
-->
<!-- Message Driven Beans -->
<!--
To add message driven beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called message-driven-beans.xml that contains
the <message-driven></message-driven> markup for those beans.
-->
</enterprise-beans>
<!-- Relationships -->
<ejb-relation >
<ejb-relation-name>Activity-ActivityDetail</ejb-relation-name>
<ejb-relationship-role >
<ejb-relationship-role-name>activities-have-details</ejb-relationship-role-name>
One
<relationship-role-source >
<ejb-name>ActivityBean</ejb-name>
</relationship-role-source>
<cmr-field >
<cmr-field-name>details</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role >
<ejb-relationship-role-name>details-belong-to-activity</ejb-relationship-role-name>
Many
<relationship-role-source >
<ejb-name>ActivityDetailBean</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation> -
3. Re: foreign-key mapped relationship problem
h2o_polo Jan 6, 2003 10:31 AM (in response to craighamilton)Ok, can you add
<primkey-field>activityID</primkey-field>
after
<prim-key-class>
I suspect that will resolve your problem. -
4. Re: foreign-key mapped relationship problem
h2o_polo Jan 7, 2003 6:54 AM (in response to craighamilton)I was just reading your posts in other threads that seem to be on the same topic. One thing that comes to my attention is why you have
<prim-key-class>java.lang.Integer</prim-key-class>
when you have a composite primary key
(activtyId,
year)
My previous guess was obviously incorrect,
but I think you just have to clean up your
ejb-jar and everything must work :-)