-->
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: Many-to-many mapping via idbag with composite key
PostPosted: Fri Mar 10, 2006 4:21 pm 
Newbie

Joined: Fri Mar 10, 2006 4:11 pm
Posts: 1
All of our tables have a composite key in place, even M2M association tables.
Our application assigns unique ID's to one element of the composite key in a save/update listener interceptor method, so we never specify generator tags in the hbm mapping files.

Is there a way to use an idbag for many-to-many relationships that use a composite key as a surrogate key? It looks like a single column name is required in the collection-id tag, and a generator tag is also required. All I'd like to do is specify the composite column names just like first-class mappings, as in:

Code:
        <composite-id name="modelIdentifier" class="com.emtrack.model.ModelIdentifier">
            <key-property name="id" type="string" column="ID"/>
            <key-property name="version" type="string" column="VERSION"/>
        </composite-id>


collection-id seems to only want a single column name and requires a generator

Thanks in advance.
Ross


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.