Load relation failed Embedded Exception Table not found
zerosleep Mar 8, 2002 4:28 PMI have a one-many unidirectional relationship setup between to two tables, two beans. I finally was able to get everything setup correctly in JBoss 3 Beta 2 and when I tried to add a bean from the many side to the Collection on the one side. I got the following error:
Load relation failed Embedded Exception Table not found: HOLES in statement [SELECT course_id, id FROM holes WHERE (course_id=11) OR (course_id=12) OR (course_id=14)]; nested exception is: javax.ejb.EJBException: Load relation failed Embedded Exception Table not found: HOLES in statement [SELECT course_id, id FROM holes WHERE (course_id=11) OR (course_id=12) OR (course_id=14)]
Now this doesn't make much sense to me because I KNOW the table exists and the SQL that jboss is using looks fine.
By commenting out the part of the code where I add the bean to the collection, I'm still able to create the bean and it shows as created in the table that jboss says doesn't exist. What could be the problem?
my jbosscmp-jdbc file:
<ejb-relation>
<ejb-relation-name>Course-CourseHoles</ejb-relation-name>
<foreign-key-mapping/>
<ejb-relationship-role>
<ejb-relationship-role-name>Course-has-many-CourseHoles</ejb-relationship-role-name>
<key-fields>
<key-field>
<field-name>id</field-name>
<column-name>course_id</column-name>
</key-field>
</key-fields>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>CourseHole-belongs-to-Course</ejb-relationship-role-name>
<key-fields/>
</ejb-relationship-role>
</ejb-relation>
my ejb-jar.xml file:
<ejb-relation>
<ejb-relation-name>Course-CourseHoles</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>Course-has-many-CourseHoles</ejb-relationship-role-name>
One
<relationship-role-source>
<ejb-name>CourseEJB</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>courseHoles</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>CourseHole-belongs-to-Course</ejb-relationship-role-name>
Many
<cascade-delete/>
<relationship-role-source>
<ejb-name>CourseHoleEJB</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>