I have a two CMP 2.1 EntityBeans called Activity and ActivityLog. ActivityLog
entries belongs to an Activity. I want to be able to navigate from the
ActivityLog to the Activity but I am not interested in navigating from
Activity to ActivityLog so it is a unidirectional 1-M relationship.
in ActivityLog I defined a CMR field as follows
/**
* @ejb.interface-method
*
* @ejb.relation
* name="Activity-ActivityLog"
* role-name="ActivityLog-belongs_to-Activity"
* target-role-name="ActivityLog-Activity"
* target-ejb="Activity"
* target-multiple="true"
*
* @jboss.target-relation
* related-pk-field="id"
* fk-column="activityId"
*
*/
public abstract Activity getActivity( );
The activity EJB does not have any CMR fields defined (since I'm not
interested in going from Activity to ActivityLog I guess I do not need to
define any).
when trying to deploy this on JBoss (4.0.1sp1) I get the following error:
org.jboss.deployment.DeploymentException: Both roles of a relation-table
mapped relationship must have key fields:
ejb-relation-name=Acitivity-ActivityLog
Both Activity and ActivityLog has a Long for primary key and the generated
ejb-jar.xml contains
<prim-key-class>java.lang.Long</prim-key-class>
and also
<primkey-field>id</primkey-field>
I've also tried adding a CMR field to Activity incase that makes any
difference:
/**
* @ejb.interface-method
*
* @ejb.relation
* name="ActivityLog-Activity"
* role-name="Activity-has-ActivityLogs"
* target-role-name="Activity-ActivityLog"
* target-ejb="ActivityLog"
*
* @jboss.target-relation
* related-pk-field="id"
* fk-column="activityId"
*
*/
public abstract Collection getActivityLogs();
But the result is the same (same exception and failure to deploy).
I'm at loss how to solve this. Any suggestions would be highly appreciated!
Best regards,
Per
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
xdoclet-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user