-->
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: Class persister for primitive type integer
PostPosted: Fri Apr 23, 2004 5:27 am 
Newbie

Joined: Fri Mar 26, 2004 8:02 am
Posts: 3
Hi,
I'm trying to access db Oracle by simple query:

String query = "from it.app.iniziative.Progetto";

where mapping file is

<hibernate-mapping>

<class name="it.app.iniziative.Progetto" table="PROJECTS">

<id name="idPRG" type="int" unsaved-value="null" >
<column name="KCODE" sql-type="number(12)" not- null="true"/>
<generator class="sequence" >
<param name="sequence">S_PROJECT</param>
</generator>
</id>

<property name="replanningQuantity" >
<column name="REPLANNINGQUANTITY" sql-type="number(12)"/>
</property>

<property name="status" sql-type="number(1)>
<column name="STATUS" />
</property>
</class>

</hibernate-mapping>


As the column STATUS has no value in db, in the log appears:

ERROR [http8070-Processor7] - [SYSTEM] Null value was assigned to a property of primitive type setter of it.app.iniziative.Progetto.status


ERROR [http8070-Processor7] - [SYSTEM] No persister for: java.lang.Integer


What can I do? Why doesn't the system find a class persister for Integer?
Thanks,
Anna


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 23, 2004 7:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Use a custom UserType which maps null to some default 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.