-->
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: int's and null fields
PostPosted: Tue Jan 20, 2004 9:09 am 
Senior
Senior

Joined: Sun Jan 04, 2004 2:46 pm
Posts: 147
If I have an "int" typed property in my .xml file and the field is defined as not-null="false" is this always a recipe for disaster? Do I need to change the type to "java.lang.Integer" to allow null values to be persisted from the database into the field?

Cheers.

Myk.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 20, 2004 9:14 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Yes, if you have nulls inside the DB you need to use an Integer, or use a custom UserType to map the nulls to some int value.


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.