-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: schemaexport for linking table
PostPosted: Mon May 10, 2004 5:55 pm 
Newbie

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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.