-->
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.  [ 2 posts ] 
Author Message
 Post subject: hbm2java - nullable primitive types - FIX
PostPosted: Wed May 12, 2004 7:32 am 
Newbie

Joined: Thu Feb 12, 2004 1:26 pm
Posts: 2
I had a problem with hbm2java (in 2.1.2 tools) whereby for properties with hibernate PrimitiveTypes (in my case "yes_no" - but also int etc.) hbm2java always generated a primitive java type - e.g. boolean - even if the property was nullable.

I solved this by changing line 225 of
net/sf/hibernate/tool/hbm2java/ClassMapping.java

from

Code:
ClassName t = getFieldType(type);


to

Code:
ClassName t = getFieldType(type,nullable,false);


and re-compiling the hibernate-tools.jar.

Works ok for me now, I get java.lang.Boolean java properties created when nullable.

Luke


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 12, 2004 8:27 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Submit a JIRA entry if you don't want this to get lost.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.