Hibernate version:
2.x
Mapping documents:
Currently I have a mapping file that looks like this:
Code:
<class
name="com.avalon.seaview.domain.Content"
table="SVD_SEAVIEWCONTENT"
lazy="true"
>
...
<set name="userPermissions" table="SVD_USERPERMISSION" lazy="true">
<cache usage="read-write"/>
<key column="ContentId"/>
<many-to-many class="com.avalon.seaview.domain.Permission" column="PermissionId"/>
</set>
<set name="groupPermissions" table="SVD_GROUPPERMISSION" lazy="true">
<cache usage="read-write"/>
<key column="ContentId"/>
<many-to-many class="com.avalon.seaview.domain.Permission" column="PermissionId"/>
</set>
...
</class>
What I would like to do is reduce the many-to-many mappings to use one table instead of two. It seems that I might be able to add a column and use a where attribute to restrict the fetch but how would I set the correct value into the table when inserting (without having to declare a new class to manage the relationship)?
Code between sessionFactory.openSession() and session.close():
n/a
Full stack trace of any exception that occurs:
n/a
Name and version of the database you are using:
n/a
The generated SQL (show_sql=true):
n/a
Debug level Hibernate log excerpt:
n/a