-->
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: Hibernate exception when field is empty
PostPosted: Fri Jul 09, 2004 7:25 am 
Newbie

Joined: Wed Mar 17, 2004 10:14 am
Posts: 14
Location: France
Hello,
When I configured Hibernate in the .hbm.xml file and I maped a table with a class, this table have a field that can be empty. The problem if thus field is empty in one record, that cause an Hibernate exception each time i try to get Data from th this table . I tried to resolve this probleme using (not-null="false")
</property>
<property name="status" type="int">
<column name="STATUS" sql-type="number" not-null="false"/>
</property>
But I still have the same problem. Do you have any idea to resolve this problem.
Thinks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 09, 2004 7:26 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Please show all of the things mentioned in the red box. You probably have a primitive type in Java, which can not be null. Use a wrapper, e.g. java.lang.Integer.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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.