Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
DataMapper 1.6.1
-
None
-
None
-
WinXp, .Net 1.1, VS2003, Oracle ODP 9.2
Description
In the following configuration, I expected a PlmDocId property to be set to NullValue=-9999 but instead got the exception:
"...
IBatisNet.Common.Exceptions.IBatisNetException: Error executing query 'FlxProcessLogMap.Save' for insert. Cause: Object cannot be cast from DBNull to other types. ---> System.InvalidCastException: Object cannot be cast from DBNull to other types.
at System.DBNull.System.IConvertible.ToInt64(IFormatProvider provider)
at System.Convert.ToInt64(Object value)
at IBatisNet.DataMapper.TypeHandlers.Int64TypeHandler.GetDataBaseValue(Object outputValue, Type parameterType)
at IBatisNet.DataMapper.MappedStatements.MappedStatement.RetrieveOutputParameters(RequestScope request, ISqlMapSession session, IDbCommand command, Object result)
at IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteInsert(ISqlMapSession session, Object parameterObject)
..."
Configuration:
<parameterMap id="SaveParameters" class="Hashtable">
<parameter property="log.PlmDocId" direction="InputOutput" column="P_PLM_DOC_ID" dbType="Int64" type="long" nullValue="-9999"/>
...
</parameterMap>