Fixed
Details
Details
Assignee
Unassigned
UnassignedReporter
Brendan Kowitz
Brendan KowitzComponents
Fix versions
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created July 10, 2008 at 12:30 AM
Updated July 15, 2008 at 12:29 AM
Resolved July 12, 2008 at 5:03 PM
The Oracle9Dialect and OracleDataClientDriver do not support Unsigned ints
This can be fixed by registering the appropriate column types:
This will allow the schema export to succeed.
public class Oracle9Dialect : Dialect
{
public Oracle9Dialect()
{
RegisterColumnType(DbType.UInt16, "NUMBER(5,0)");
RegisterColumnType(DbType.UInt32, "NUMBER(10,0)");
RegisterColumnType(DbType.UInt64, "NUMBER(20,0)");
...
Getting the values back to NHibernate also requires the OracleDataClientDriver to be modified,
Don't know how this code will fit into the codebase with a dependency on Oracle.DataAccess..
protected override void InitializeParameter(IDbDataParameter dbParam, string name, SqlType sqlType)
{
//more information about mapping to native oracle types:
//http://download-uk.oracle.com/docs/cd/B19306_01/win.102/b14306/appendixa.htm#BEHJHHJG
OracleDbType oraType;
if(sqlType.DbType == DbType.UInt16)
{
oraType = OracleDbType.Decimal;
}
else if(sqlType.DbType == DbType.UInt32)
{
oraType = OracleDbType.Decimal;
}
else if(sqlType.DbType == DbType.UInt64)
{
oraType = OracleDbType.Decimal;
}
else if(sqlType.DbType == DbType.Int64)
{
oraType = OracleDbType.Decimal;
}
else if(sqlType.DbType == DbType.DateTime)
{
oraType = OracleDbType.TimeStamp;
}
else
{
//Let the base driver class in NHibernate handle the parameter initialisation
base.InitializeParameter(dbParam, name, sqlType);
return;
}
dbParam.ParameterName = FormatNameForParameter(name);
((OracleParameter)dbParam).OracleDbType = oraType;
...