Hi,
I'm trying to create unidirectional many-to-many association. Following are the hbm mappings.
Code:
<hibernate-mapping>
<class name="com.abc.Person" table="Person" lazy="true">
<cache usage="read-write" />
<id name="id" column="ID" type="long" length="30" unsaved-value="null">
<generator class="native">
<param name="sequence">PERSON_SEQ</param>
</generator>
</id>
<property name="name" type="string" update="true" insert="true" column="NAME" length="255" not-null="true"
unique="true" />
<joined-subclass name="com.abc.User" table="User" lazy="true">
<key column="IDENTIFIER" />
<property name="email" type="string" update="true" insert="true" column="EMAIL" length="255" />
<set name="reminders" table="User_Reminder" inverse="true" lazy="true" cascade="none">
<cache usage="read-write" />
<key column="USER_ID" not-null="true" />
<many-to-many class="com.xyz.Reminder" column="REMINDER_ID" />
</set>
</joined-subclass>
</class>
</hibernate-mapping>
<hibernate-mapping package="com.xyz">
<class name="Reminder" table="REMINDER">
<cache usage="read-write" />
<id name="id" column="ID" type="long" length="30" unsaved-value="null">
<generator class="native">
<param name="sequence">REMINDER_SEQ</param>
</generator>
</id>
<property name="name" type="string" update="true" insert="true" column="NAME" length="255" not-null="true"
unique="true" />
<property name="description" type="string" update="true" insert="true" column="DESCRIPTION" length="1024" />
</class>
</hibernate-mapping>
I've included both the hbms in the hibernate.cfg.xml file
<mapping resource="com/xyz/hbm/Reminder.hbm.xml" />
<mapping resource="com/abc/hbm/Person.hbm.xml" />
Please note that, both the class files are in different packages. Also their corresponding hbm files are in different folders, which I think, should not be an issue.
Every time I deploy the war and start the JBoss, I get the following error.
Quote:
01:05:13,484 INFO [STDOUT] ERROR 01:05:13,484 (ORMConnection) - An association from the table USER_REMINDER refers to an unmapped class: edu.xyz.Reminder
01:05:13,484 ERROR [[/myapp]] StandardWrapper.Throwable
org.hibernate.MappingException: An association from the table USER_REMINDER refers to an unmapped class: edu.xyz.Reminder
Please help me solving this issue. Let me know where I'm going wrong. I've been stuck with this problem for too long now.
Thanks