Using Hibernating 3.0.5 and Tools 3.0alpha4...
I am new to Hibernate, so I may be misunderstanding how the properties tag works.
I am trying to use the properties tag to specify that the combination of 2 columns should be unique.
A simplified version of the .hbm.xml below:
Code:
<class name="Foo">
<id name="id" type="long">
<generator class="native"/>
</id>
<properties name="uniqueCombo" unique="true">
<property name="prop1" type="string"/>
<property name="prop2" type="string"/>
</properties>
<property name="prop3" type="string"/>
<property name="prop4" type="string"/>
<many-to-one name="bar" class="Bar" column="bar_id"/>
</class>
...
When I run this through the hbm2java Ant task, the only properties of the POJO are prop1 and prop2 (the ones nested inside the properties tag). The other properties/associations are missing.
But when I run this through the hbm2ddl Ant task, it produces db columns for all of the properties (both those nested inside the properties tag, as well as the ones outside of the properties tag).
Misunderstanding how the properties tag works? Bug in hbm2java?
Please help.
Thanks in advance.
-Tim.