-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: hbm2java and UserTypes
PostPosted: Thu Jul 28, 2005 7:08 pm 
Newbie

Joined: Tue Oct 26, 2004 3:55 pm
Posts: 5
I have a UserType that i'm trying to use, but hbm2java generates the wrong java code for it. It creates the setter/getter using the UserType class, not the type that the UserType returns. Any suggestions would be helpful. Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 29, 2005 3:33 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
how about including the class for the usertype in the classpath so hbm2java can see it and ask it what type it is representing ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 07, 2008 5:28 pm 
Newbie

Joined: Wed Oct 31, 2007 9:16 pm
Posts: 9
The problem with that (at least in my case) is we run
hbm2java before we compile, so that we can compile
its output along with everything else. So there is no way
to put it in the classpath. However, I found this in another
forum post, and it seems to work for me:

<property name="xyz" type="com.mycompany.MyUserType">
<meta attribute="property-type">com.mycompany.MyType</meta>
</property>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 10, 2008 8:06 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
that works too - the code generation does not have a way to know the type without the UserType class or the property-type attribute as you correctly give an example of.

Thanks for that ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 01, 2009 9:38 am 
Newbie

Joined: Mon Sep 26, 2005 8:43 am
Posts: 16
Thanks folks. This helped solve my problem.

_________________
--Beejal


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.