Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Double == null ?

807606Feb 15 2007 — edited Feb 15 2007
Using Hibernate, I get some data from my db. These datas are doubles.

All the getter & setter are using double into the next example.
crm.setEfforts(cc.getMxDocumentationMan()+cc.getMxImplementationMan()+cc.getMxProjectAnalysisMan()+cc.getMxProjectManagementMan()+cc.getMxQaMan()+cc.getMxMindDevMan());
Thing is, when I run my script, I get the following:
[java] java.lang.NullPointerException
[java]     at com.mx.releasemgr.change.ViewChangeReportAction.getChangeReport(ViewChangeReportAction.java:327)
And line 327 is this one, obviously...
crm.setEfforts(cc.getMxDocumentationMan()+cc.getMxImplementationMan()+cc.getMxProjectAnalysisMan()+cc.getMxProjectManagementMan()+cc.getMxQaMan()+cc.getMxMindDevMan());
And I can't check if the double are null since it is not possible in java since double shouldnt be null but 0....

How can i fix that ? Changing my hibernate xml mapping file to specify that theses fields are double in the "type" tag ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 15 2007
Added on Feb 15 2007
4 comments
133 views