Hello,
I use <properties> to group multiple properties to define a logical key for a multi-column unique constraint in a <map>.
Code:
<property name="ID" column="ID" type="long" />
<property name="NUMBER" column="NUMBER" type="integer" />
<properties name="KEY" unique="true" insert="false" update="false">
<property name="ID" column="ID" type="long" insert="false" update="false" />
<property name="NUMBER" column="NUMBER" type="integer" insert="false" update="false" />
</properties>
<map name="LIST" inverse="true" fetch="select" cascade="all">
<key property-ref="KEY">
<column name="ID" />
<column name="NUMBER" />
</key>
<map-key column="NAME" type="string" />
<one-to-many entity-name="LIST" />
</map>
This seems to work, but I need to know, what Java-Type is used internal to handle the properties as a key? Which Classtype has the getKEY() Method to return?
Is it a Map? I so, what are the keys and values of the map?
Hibernate version: 3.2.5.ga
regards