File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ public DB2Dialect()
55
55
RegisterColumnType ( DbType . String , 8000 , "VARCHAR($l)" ) ;
56
56
RegisterColumnType ( DbType . String , 2147483647 , "CLOB" ) ;
57
57
RegisterColumnType ( DbType . Time , "TIME" ) ;
58
+ RegisterColumnType ( DbType . Guid , "CHAR(16) FOR BIT DATA" ) ;
58
59
59
60
RegisterFunction ( "abs" , new StandardSQLFunction ( "abs" ) ) ;
60
61
RegisterFunction ( "absval" , new StandardSQLFunction ( "absval" ) ) ;
Original file line number Diff line number Diff line change 2
2
using System . Data ;
3
3
using System . Data . Common ;
4
4
using NHibernate . Engine ;
5
+ using NHibernate . SqlTypes ;
5
6
6
7
namespace NHibernate . Driver
7
8
{
@@ -10,6 +11,8 @@ namespace NHibernate.Driver
10
11
/// </summary>
11
12
public abstract class DB2DriverBase : ReflectionBasedDriver
12
13
{
14
+ private static readonly SqlType GuidSqlType = new SqlType ( DbType . Binary , 16 ) ;
15
+
13
16
/// <param name="assemblyName"></param>
14
17
/// <exception cref="HibernateException">
15
18
/// Thrown when the <c>assemblyName</c> assembly can not be loaded.
@@ -47,7 +50,15 @@ public override IResultSetsCommand GetResultSetsCommand(ISessionImplementor sess
47
50
48
51
protected override void InitializeParameter ( DbParameter dbParam , string name , SqlType sqlType )
49
52
{
50
- dbParam . DbType = sqlType . DbType ;
53
+ switch ( sqlType . DbType )
54
+ {
55
+ case DbType . Guid :
56
+ dbParam . DbType = DbType . Binary ;
57
+ break ;
58
+ default :
59
+ dbParam . DbType = sqlType . DbType ;
60
+ break ;
61
+ }
51
62
}
52
63
}
53
64
}
You can’t perform that action at this time.
0 commit comments