Sorry - I forgot to mention the error I was getting :) When I deploy the bean with the CMR tags specified I get the message :
MBeanException: org.jboss.deployment.DeploymentException: Role 'reporting-group' on Entity Bean 'Employee' : CMP field for key not found: field name='managerId' Cause: org.jboss.deployment.DeploymentException: Role 'reporting-group' on Entity Bean 'Employee' : CMP field for key not found: field name='managerId' at org.jboss.mx.server.ReflectedDispatcher.handleInvocationExceptions(ReflectedDispatcher.java:91) at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:64) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53) at org.jboss.mx.server.Invocation.invoke(Invocation.java:86) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473) at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:837) But I do have the managerId field in my class : /** * * @ejb.interface-method * * @ejb.persistence * column-name = "mgrid" * jdbc-type = "VARCHAR" * sql-type = "VARCHAR(5)" * * @ejb.value-object * match = "light" * * @return */ public abstract String getManagerId(); >From my jbosscmp.xml file : <cmp-field> <field-name>managerId</field-name> <column-name>mgrid</column-name> <jdbc-type>VARCHAR</jdbc-type> <sql-type>VARCHAR(5)</sql-type> </cmp-field> I am rather new to the XDoclet terminology - so a little confused. How do I establish the CMR here ? I already have a relation-table preference established at my project level. From the jbosscmp.xml file : <jbosscmp-jdbc> <defaults> <datasource>java:/DefaultDS</datasource> <datasource-mapping>mySQL</datasource-mapping> <create-table>true</create-table> <remove-table>true</remove-table> <preferred-relation-mapping>relation-table</preferred-relation-mapping> </defaults> ... ... Thanks. --- Stefan Champailler <[EMAIL PROTECTED]> wrote: > euh, not sure to understand your question, but maybe > @jboss.relation-table is > what you're looking for... > > stF > > > > Hello, > > > > I want to establish a self-referencing CMR - for > > example, employee-manager CMR. I have a field > > managerId in the entity. The CMR is to get a list > of > > all employees reporting to that manager : > > > > /** > > * @ejb.interface-method > > * > > * @ejb.relation > > * name = "managers-employees" > > * role-name = "manager" > > * target-ejb = "Employee" > > * target-role-name = "reporting-group" > > * > > * @jboss.relation > > * related-pk-field = "managerId" > > * fk-column = "mgrid" > > * > > * @jboss.target-relation > > * related-pk-field = "id" > > * fk-column = "id" > > * > > * @ejb.value-object > > * relation = "external" > > * aggregate = "test.interfaces.EmployeeValue" > > * aggregate-name = "reports" > > * members = "test.interfaces.EmployeeLocal" > > * members-name = "reports" > > * type = "java.util.Collection" > > * > > * @return > > */ > > public abstract Collection getDirectReports(); > > > > My EJB Module project is building with > > preferredRelation as "relation-table". I guess it > is > > this preference which is casuing the problem ? Can > I > > over-ride the relation-table for this CMR ? How > should > > I do this, if so ? > > > > Thanks > > > > > > > > > > > > > ___________________________________________________________ALL-NEW > Yahoo! > > Messenger - all new features - even more fun! > > http://uk.messenger.yahoo.com > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: IT Product > Guide on ITManagersJournal > > Use IT products in your business? Tell us what you > think of them. Give us > > Your Opinions, Get Free ThinkGeek Gift > Certificates! Click to find out more > > > http://productguide.itmanagersjournal.com/guidepromo.tmpl > > _______________________________________________ > > xdoclet-user mailing list > > [EMAIL PROTECTED] > > > https://lists.sourceforge.net/lists/listinfo/xdoclet-user > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide > on ITManagersJournal > Use IT products in your business? Tell us what you > think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! > Click to find out more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > xdoclet-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/xdoclet-user > ___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user