-->
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: using simple Java types with non-null=false
PostPosted: Thu Jul 21, 2005 4:54 am 
Newbie

Joined: Thu Jul 21, 2005 4:50 am
Posts: 5
I would like to know if simple Java types (i.e. int) are supported with the non-null set to false. I am getting a null exception when the value retrieved from the DB is NULL. It works if I use the wrapper class (i.e. Integer).

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 21, 2005 6:33 am 
Regular
Regular

Joined: Wed Feb 02, 2005 6:33 am
Posts: 70
The primitive types in java cannot be null. Each will default to a certain value (e.g. boolean is false) when added as a field on a class without being initialised.

Wrapper classes are objects, so they can be null.


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.