I have no problems constructing CMRs apart from unidirectional one to many. I am trying to use the XDoclet below but JBoss error is:
Both roles of a relation-table mapped relationship must have key fields
Do I really need a relation table for CMRs or do I miss something in my XDoclet? With plain SQL I dont need any relation tables to make a Unidirectional 1:M.
/**
* @ejb.interface-method
* view-type="local"
*
* @ejb.relation
* name="ServiceDetail-Security"
* role-name = "one-ServiceDetail-has-many-Security"
* target-role-name="one-Security-belongs-to-one-ServiceDetail"
* target-ejb = "Security"
* target-multiple="yes"
*
* @jboss.target-relation
* related-pk-field = "serviceId"
* fk-column = "SERVICE_ID"
*/
public abstract java.util.Collection getSecurities();
Thanks
Goran
No you don't need a relation table for one to many relationships. There's something wrong with your XDoclet tags.
-- Juha