Diego
2004-03-23 08:22:05 UTC
Hi everyone!
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/viewcvs.py/*checkout*/middlegen/middlegen/plugins/hibernate/src/middlegen/plugins/hibernate/HibernateJavaTypeMapper.java?content-type=text%2Fplain&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.
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
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/viewcvs.py/*checkout*/middlegen/middlegen/plugins/hibernate/src/middlegen/plugins/hibernate/HibernateJavaTypeMapper.java?content-type=text%2Fplain&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.
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.