Hello. I have a build script that uses net.sf.hibernate.tool.hbm2ddl.SchemaExportTask to generate database tables from hibernate config files. Everything was working until I modified two classes (and hibernate config files) to have a one-to-many and many-to-one relationship: A "Customer" can have many "Devices". Now when I run my build script to populate the database tables, I get a "ClassNotFoundException: Device" when trying to translate the Customer object.
I understand the dependence, but I don't know how to get around it. Does the SchemaExportTask not support many-to-many relationships?
Hibernate version:
Hibernate 3.0
Mapping documents:
Snippet of Customer.hbm.xml:
------------
<hibernate-mapping
>
<class
name="com.smslocate.mmp.user.Customer"
table="customer"
dynamic-update="false"
dynamic-insert="false"
select-before-update="false"
optimistic-lock="version"
>
<set
name="deviceList"
lazy="false"
inverse="true"
cascade="all-delete-orphan"
sort="unsorted"
order-by="msisdn"
>
<key column="id"> </key>
<one-to-many
class="Device"
/>
</set>
--------------
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
|