Mike,
I have already tried that solution with XDoclet. And my xdoclet parser is generating a invalid hbm file. Then I referred to hibernate-mapping-3.0.dtd
http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd
It has the following defination for properties
*******************************************
<!-- properties declares that the contained properties form an alternate key. The name
attribute allows an alternate key to be used as the target of a property-ref. -->
<!ELEMENT properties (
(property|many-to-one|component|dynamic-component)*
)>
<!ATTLIST properties name CDATA #REQUIRED>
<!ATTLIST properties unique (true|false) "false">
<!ATTLIST properties insert (true|false) "true">
<!ATTLIST properties update (true|false) "true">
<!ATTLIST properties optimistic-lock (true|false) "true">
<!ATTLIST properties node CDATA #IMPLIED>
**************************************************
And here what I have to write in Person.hbm.xml
<properties name="subject_batch_unique" unique="true">
<many-to-one
name="subject"
not-null="true"
cascade="save-update"
lazy="false"
>
</many-to-one>
<many-to-one
name="batch"
not-null="true"
>
</properties>
So after generating my hbm using xdoclet, I have to add the above text for properties. I wish xdoclet could have parsed this properly.
P.S. It is always better to refer to the hibernate-mapping-xxx.xx.dtd to resolve the issues. We can't trust the tools like xdoclet as it not fully mature and well developed.
Thanks
Shyam