Joined: Mon May 10, 2004 5:45 pm Posts: 9
|
Is there a way for the schemaexport tool to generate extra columns in a linking table used as a type column indicator.
For example, Here is a snippet of a mapping in my User.hbm.xml file:
<!-- Roles -->
<set name="roles" table="role_link" lazy="false" inverse="true" cascade="save-update" where="type = 'user">
<key column="id"/>
<many-to-many class="com.rsm.domain.security.Role" column="role_id" outer-join="auto"/>
</set>
I want schema export to generate an extra colum in the role_link called 'type'. This will indicate what kind of entity the column under 'id' is.
Background on wanting this functionality:
I was also thinking of having a Group object/class that had a many-to-many association with roles and didn't want to create another linking table that had the same structure as the table above.
|
|