I do not know who is responsible for XDoclet CVS modifications, but these ones should be added as soon as possible...
As I have problems with a many-to-one relationship and I am using XDoclet to generate my hbm files, I have been having a look at XDoclet code and I have found this:
File:
xdoclet/modules/hibernate/src/xdoclet/modules/hibernate/resources/hibernate-properties.xdt
It says:
Code:
<XDtMethod:ifHasMethodTag tagName="hibernate.many-to-one">
<many-to-one
name="<XDtMethod:propertyName/>"
class="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="class" default="<XDtMethod:methodType/>" />"
cascade="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="cascade" values="none,all,save-update,delete" default="none"/>"
outer-join="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="outer-join" values="true,false,auto" default="auto"/>"
<XDtConfig:ifConfigParamEquals paramName="version" value="2.0">
update="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="update" values="true,false" default="true"/>"
insert="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="insert" values="true,false" default="true"/>"
access="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="access" values="field,property,Class" default="property"/>"
<XDtMethod:ifHasMethodTag tagName="hibernate.many-to-one" paramName="foreign-key">
foreign-key="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="foreign-key"/>"
</XDtMethod:ifHasMethodTag>
<XDtMethod:ifHasMethodTag tagName="hibernate.many-to-one" paramName="property-ref">
property-ref="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="property-ref"/>"
</XDtMethod:ifHasMethodTag>
</XDtConfig:ifConfigParamEquals>
<XDtHibernate:setCurrentTag name="hibernate.many-to-one" mappingElement="many-to-one">
<XDtMerge:merge file="xdoclet/modules/hibernate/resources/hibernate-column.xdt">
</XDtMerge:merge>
</XDtHibernate:setCurrentTag>
</XDtMethod:ifHasMethodTag>
ant it had to say:Code:
<XDtMethod:ifHasMethodTag tagName="hibernate.many-to-one">
<many-to-one
name="<XDtMethod:propertyName/>"
class="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="class" default="<XDtMethod:methodType/>" />"
cascade="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="cascade" values="none,all,save-update,delete" default="none"/>"
outer-join="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="outer-join" values="true,false,auto" default="auto"/>"
<XDtConfig:ifConfigParamEquals paramName="version" value="2.0">
not-null="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="not-null" values="true,false" default="false"/>"
unique="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="unique" values="true,false" default="false"/>"
update="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="update" values="true,false" default="true"/>"
insert="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="insert" values="true,false" default="true"/>"
access="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="access" values="field,property,Class" default="property"/>"
<XDtMethod:ifHasMethodTag tagName="hibernate.many-to-one" paramName="foreign-key">
foreign-key="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="foreign-key"/>"
</XDtMethod:ifHasMethodTag>
<XDtMethod:ifHasMethodTag tagName="hibernate.many-to-one" paramName="property-ref">
property-ref="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="property-ref"/>"
</XDtMethod:ifHasMethodTag>
<XDtMethod:ifHasMethodTag tagName="hibernate.many-to-one" paramName="index">
index="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="index"/>"
</XDtMethod:ifHasMethodTag>
</XDtConfig:ifConfigParamEquals>
<XDtHibernate:setCurrentTag name="hibernate.many-to-one" mappingElement="many-to-one">
<XDtMerge:merge file="xdoclet/modules/hibernate/resources/hibernate-column.xdt">
</XDtMerge:merge>
</XDtHibernate:setCurrentTag>
</XDtMethod:ifHasMethodTag>
having added these lines:
Quote:
not-null="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="not-null" values="true,false" default="false"/>"
unique="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="unique" values="true,false" default="false"/>"
Quote:
<XDtMethod:ifHasMethodTag tagName="hibernate.many-to-one" paramName="index">
index="<XDtMethod:methodTagValue tagName="hibernate.many-to-one" paramName="index"/>"
</XDtMethod:ifHasMethodTag>
BECAUSE these three methods are used in xdoclet documentation and dtd.
In fact, I only needed the first one but DTD has got defined the other two, also.
Now, my hbm file is properly generated with my many-to-one
Quote:
not-null="true"