can't see the source attachment...
curious about your accessor method naming, since you're using all uppercase DEPT_ID as your CMR field name... this field is case sensitive, so for instance setDepartmentID maps to <field-name>departmentID</field-name> (notice the change in case)
I was't able to attach the files then.
try switching the key field mapping to the EMP side of the relationship in jbosscmp-jdbc.xml
I have changed as you said but still the problem exists, please see the attachments.
The XML looks fine. As a test to see whether the processing/interpretation of the XML is at fault, why don't you try moving the relationship role with key fields to the front - rather than having the relationship role without any key fields first in the sequence of relationship role declarations in jbosscmp-jdbc.xml. At least it will match the guide's example. I'd be surprised if the sequence altered anything but if you've exhausted everything else, it is worth a shot.
In the attached .zip it looks like the relationship name is inconsistent in the two .xml files ("EMP-DEPT" and "DEPT-EMP").
Perhaps there is also a problem with your field names. As one of the other answers pointed out, when you define CMP field accessors "getBlah()" and "setBlah()", you will generate a field (on your EJB) called "blah". The field names in your code may thus be "dEPT_ID" and "eMP_ID", so you may need to change your xml accordingly.
Other than that, I can't see any obvious problem with your XML (but I'm certainly no expert).
It may be worth trying xdoclet to generate your EJB files, including the deployment descriptors. JBoss supplies an xdoclet template project (which has a few errors), and there is also an XPETSTORE sample application.
I have attached xdoclet generated xml for a one-to-many, biderectional relation, such as the one you are defining. In this model, a "ledger" has a collection of "LedgerEntries". The LedgerEntry table has a "LEDGERFK" field, specifying the foreign key of the associated ledger. The ledger EJB has a fild called "key".
Hope this helps. Good luck.
Thank you all for the help, Problem with relationships got corrected when I changed the case of the fields. But now I am getting the following error with the EJBQL.
This comes with 'WHERE' clause, when the this clause removed it works fine.
MBeans waiting for other MBeans:
I Depend On:
Depends On Me: org.jboss.deployment.DeploymentException: Error compiling ejbql; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "p.emp_id" at line 3, column 25.
Was expecting one of:
This is how the query defined.
FROM emp p
FROM emp AS p
This error comes with fields which is having data type java.lang.Number.
It works fine with String and Date. Is there any problem in using Number !!.