Re: Problems with javaTypeMapper

Eivind Waaler <[email protected]>
Newsgroups gmane.comp.java.ejb.middlegen.user
Message-ID <[email protected]>
Hi, seems like a weird problem.

This seems to work with the HibernateJavaTypeMapper. You could try asking
at the hibernate tools forum, as the developer for the hibernate plugin is
more likely to answer the question there:

http://forum.hibernate.org/viewforum.php?f=6

Cheers
.eivind

On Tue, 23 Mar 2004, Diego wrote:

> 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.
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> middlegen-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/middlegen-user
>
>


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.