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