-->
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.  [ 1 post ] 
Author Message
 Post subject: NHibernate 2.0 and Oracle 10.2 and C# .NET 2.0 null numbers
PostPosted: Wed Aug 20, 2008 9:51 pm 
Newbie

Joined: Wed Aug 20, 2008 7:52 pm
Posts: 2
After much research, I am unable to solve the following problem.

I need to pass a null value from C# to NHibernate to Oracle.

ex.

C# snipet:
int? slope = null;
double? curvature = null;

Oracle:
the two corresponding columns allow null


NHibernate Config

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="SplinePublish.ShapePublishRecord, SplinePublish" table="NT_CV_SPLINE_SHAPE_POINT">
<id name="DbID" column="SHAPE_PUBLISH_ID">
<generator class="native">
<param name="sequence">SPLINE_SHAPE_PUBLISH_ID_SEQ</param>
</generator>
</id>
<property name="LinkId" column="LINK_ID"/>
<property name="Sequence" column="SEQUENCE"/>
<property name="VertFlagChar" column="IS_VERTICAL_ONLY" />
<property name="latitude" column="HPLAT" access="field" />
<property name="longitude" column="HPLON" access="field"/>
<property name="Height" column="HPELEVATION" />
<property name="Curvature" column="CURVATURE" />
<property name="Heading" column="HEADING" />
<property name="Slope" column="SLOPE" />
<property name="ZLevel" column="ZLEVEL" />
<property name="SplineId" column="SPLINE_ID" />
<property name="SplineStampId" column="SPLINE_STAMP_ID" />
</class>
</hibernate-mapping>

I get an error saying that it can't insert because Oracle is expecting a number and receiving a binary.

Can anyone help?

Thank you in advance.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.