While working on my degree project i came across a situation where i needed a one-to-one relationship. Among the two methods to implement such relationship in hibernate, i choose to use the foreign-key method other than the shared primary key method.
I was unable to do a schemaExport because of xdoclet generating two unique=”true” attributes in the .hbm file.
Google found me this link http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1665 where it is reported as a bug which is open at the time of writing.
After playing around with it for some time i figured out that by adding a @hibernate.column would stop Xdoclet generating two unique=”true” attributes which in turn is converted to the mapping xml file which becomes invalid according to the hibernate-3.0.dtd.
Initial xdoclet tag was.
I was able to get rid of this error by adding a column and setting the unique-key.