Hi sesques, Thanx for ur reply.I really could not figure out the problem. Well I have now changed the database schema as
Question q_id q_text rightChoice choiceid Choice choiceid choice1 choice2 choice3 Well the portion of ejb-jar.xml is not much different. As u can see from the database structure i want my choiceid column in Question table to act as a Foreign-key for Choice table's choiceid primary key. Even after these settings the same problem which i have mentioned above still persists.JBoss is still creating a new Field "Choices" probably corresponding to "ChoicesLocal getChoices()".But this is a CMR field then why does JBOss creates a column for that field..? Really cant understand.Please help me. Here is a snippet of jbosscmp-jdbc.xml generated by XDoclet for me. <ejb-relation> <ejb-relation-name>Question-Has-A-Choices</ejb-relation-name> <ejb-relationship-role> <ejb-relationship-role-name>Question-Of-A-Choice </ejb-relationship-role-name> <key-fields/> </ejb-relationship-role> <ejb-relationship-role> <ejb-relationship-role-name>Choices-Of-A-Question </ejb-relationship-role-name> <key-fields> <key-field> <field-name>choiceid</field-name> <column-name>choiceid</column-name> </key-field> </key-fields> </ejb-relationship-role> </ejb-relation> <a href="http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3824664#3824664">View the original post</a> <a href="http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3824664>Reply to the post</a> ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user