I'm attempting to implement a solution using only XML instead of annotations for JPA persistence.
Hibernate Entity Manager 3.3.1.ga
However, I've run into a snag where for an XML segment like this:
<many-to-many name="teachers" mapped-by="students" target-entity="Teachers" >
<join-table name="MYTEACHER_MYSTUDENT" >
<join-column name="TEACHER_ID"/>
<inverse-join-column name="STUDENT_ID"/>
</join-table>
</many-to-many>
The join table does not seem to be recognize - it throws something like this:
Code:
Dec 21, 2007 3:45:33 PM org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: Invalid object name 'TEACHERS_STUDENTS'.
TEACHERS and STUDENTS are the respective table names of the entities, but defining my own join-table name 'MYTEACHER_MYSTUDENT' it ignores this. Creating a table to match what it wants partially corrects the problem, but I would like someone else with more experience to verify if this is a real problem or just my ignorance.