GRoK This!
XDoclet, Hibernate, many-to-one lazy attribute
I mentioned earlier about how XDoclet was not generating Hibernate's "lazy" attribute for the many-to-one tag. Well, I found an easy fix. I had to download the XDoclet source code and peruse it, but after a while I understood that there's a lot more XML files than Java files, and so all I had to do was modify the correct XML file instead of changing the Java code and rebuilding XDoclet. The file you want to change is in the xdoclet-hibernate-module-1.2.3.jar file that comes with XDoclet binaries. Explode that file into some temp directory and edit the file xdoclet\modules\hibernate\resources\hibernate-properties.xdt. Find the element that has this attribute: tagName="hibernate.many-to-one". Add the following child element to it. I put it after the element that has this attribute: paramName="unique".
Save the file and zip it back up into a jar file. I called this new jar file xdoclet-hibernate-module-1.2.3.1.jar. Use that jar file instead of the normal xdoclet-hibernate-module-1.2.3.jar file.
Posted at 08:45AM Apr 26, 2007 by Gary Kephart in Computers | Comments[0]