I have a many to many relationship defined that is not working correctly.
When I try to get the collection object from one of the entities it returns
a collection with a size of 0. I've checked the relation table and there is
data that is returned when I query it with the same select statement I find
in the server.log file. Any ideas?
Here's an excerpt from the server.log:
2002-06-12 09:55:23,208 ERROR [STDERR] Getting items
2002-06-12 09:55:23,228 DEBUG
[org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadRelationCommand.JobEJB] Executing
SQL: SELECT JOBITEM FROM JOB_JOBITEMS WHERE (JOB=?)
2002-06-12 09:55:23,248 ERROR [STDERR] jobitems count 0
Here's the relationship in the ejb-jar.xml:
<ejb-relation>
<ejb-relation-name>Job-JobItem</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>job-has-jobitems</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>JobEJB</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>jobItems</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>jobitem-iscomponentof-job</ejb-relationship-role
-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>JobItemEJB</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
Here's the definition in the jbosscmp-jdbc.xml file:
<ejb-relation>
<ejb-relation-name>Job-JobItem</ejb-relation-name>
<relation-table-mapping>
<table-name>JOB_JOBITEMS</table-name>
</relation-table-mapping>
<ejb-relationship-role>
<ejb-relationship-role-name>job-has-jobitems</ejb-relationship-role-name>
<key-fields>
<key-field>
<field-name>jobID</field-name>
<column-name>JOB</column-name>
</key-field>
</key-fields>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>jobitem-iscomponentof-job</ejb-relationship-role
-name>
<key-fields>
<key-field>
<field-name>jobItemID</field-name>
<column-name>JOBITEM</column-name>
</key-field>
</key-fields>
</ejb-relationship-role>
</ejb-relation>
--
Jason Craven <[EMAIL PROTECTED]>
Sr. Developer, Application Development & Integration
Nextel Communications, Inc.
678.878.1655
_______________________________________________________________
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user