Hi!
I'm posting a message that I sent to the middlegen-user mailing list. I was suggested to send it to this forum, so here it is:
I'm having problems using the Hibernate plugin
(
http://www.hibernate.org/98.html).
I want middlegen to generate only non-primitive types for the hbm.xml files. As
far as I know, this can be made through the javaTypeMapper attribute of the
<hibernate> tag inside build.xml.
I created a class similar to this one:
http://cvs.middlegen.sourceforge.net/vi ... in&rev=1.2
but returning always object types (just as this one does for primary keys, but
for all fields).
I've referenced my class this way in build.xml:
<hibernate
destination="${build.gen-src.dir}"
package="${name}.persistence"
genXDocletTags="true"
genIntergratedCompositeKeys="false"
javaTypeMapper="mypackage.MyTypeMapper"
/>
And I placed it inside a jar under /lib directory.
The problem is that middlegen seems to overlook it. No matter what I return in
getPreferredJavaType method, the hbm.xml files are generated always the same
way.
Middlegen finds the class, because if I remove it from the /lib directory, I get
a ClassNotFound exception when I run "ant hbm2java".
Any ideas of what am I doing wrong?
Thanks in advance.