-->
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.  [ 5 posts ] 
Author Message
 Post subject: setting null value to a double column fails?
PostPosted: Sat Mar 20, 2004 12:43 pm 
Newbie

Joined: Tue Mar 09, 2004 8:58 am
Posts: 15
Hi,
I get this exception when trying on fetching records using session.load(). The column on which this fails has a null value and the data type of the column in double.

net.sf.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.ge.erc.uww.actuarial.ro.OLAPricingLayerRow.setLimitPct

Caused by: net.sf.cglib.beans.BulkBeanException
at com.ge.erc.uww.actuarial.ro.OLAPricingLayerRow$$BulkBeanByCGLIB$$e6ba9662.setPropertyValues(<generated>)
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:208)
... 45 more
Caused by: java.lang.NullPointerException
... 47 more


The java variable declaration:
Code:
       private double limitPct;
   public double getLimitPct() {
      return limitPct;
   }
   public void setLimitPct(double d) {
      limitPct = d;
   }




Hibernate mapping file:
Code:
<property name="limitPct" column="LIMIT_PCT" type="double"/>



Would anybody know why this's happening?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 20, 2004 12:49 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
private double limitPct;

you cannot use primitive types for attributes that can be null :) use Double instead of double....


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 20, 2004 12:53 pm 
Newbie

Joined: Tue Mar 09, 2004 8:58 am
Posts: 15
Thanks!
-Ram


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 23, 2004 4:34 am 
Senior
Senior

Joined: Sun Mar 14, 2004 10:16 am
Posts: 129
Location: Ankara
If I need "not Double" but double, what should I do?

_________________
-developer


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 24, 2004 12:08 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Put a "not null" constraint on the database column and then map it as double.


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