File tree 6 files changed +71
-17
lines changed
NHibernate.TestDatabaseSetup
6 files changed +71
-17
lines changed Original file line number Diff line number Diff line change @@ -123,10 +123,15 @@ public bool SupportsSqlType(SqlType sqlType)
123
123
/// </summary>
124
124
public virtual bool SupportsModuloOnDecimal => true ;
125
125
126
+ /// <summary>
127
+ /// Supports sub-selects in order by clause
128
+ /// </summary>
129
+ public virtual bool SupportsSubSelectsInOrderBy => _dialect . SupportsScalarSubSelects ;
130
+
126
131
/// <summary>
127
132
/// Supports aggregating sub-selects in order by clause
128
133
/// </summary>
129
- public virtual bool SupportsAggregatingScalarSubSelectsInOrderBy => _dialect . SupportsScalarSubSelects ;
134
+ public virtual bool SupportsAggregatingScalarSubSelectsInOrderBy => SupportsSubSelectsInOrderBy ;
130
135
131
136
/// <summary>
132
137
/// Supports order by and limits/top in correlated sub-queries
Original file line number Diff line number Diff line change
1
+ namespace NHibernate . Test . TestDialects
2
+ {
3
+ public class DB2TestDialect : TestDialect
4
+ {
5
+ public DB2TestDialect ( Dialect . Dialect dialect ) : base ( dialect )
6
+ {
7
+ }
8
+
9
+ public override bool HasBrokenTypeInferenceOnSelectedParameters => true ;
10
+ public override bool SupportsCancelQuery => false ;
11
+ public override bool SupportsComplexExpressionInGroupBy => false ;
12
+ public override bool SupportsNonDataBoundCondition => false ;
13
+ public override bool SupportsSelectForUpdateWithPaging => false ;
14
+ public override bool SupportsSubSelectsInOrderBy => false ;
15
+ }
16
+ }
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ public class DatabaseSetup
32
32
{ "NHibernate.Driver.OracleManagedDataClientDriver" , SetupOracle } ,
33
33
{ "NHibernate.Driver.OdbcDriver" , SetupSqlServerOdbc } ,
34
34
{ "NHibernate.Driver.SQLite20Driver" , SetupSQLite } ,
35
+ { "NHibernate.Driver.DB2Driver" , SetupDB2 } ,
36
+ { "NHibernate.Driver.DB2CoreDriver" , SetupDB2 } ,
37
+ { "NHibernate.Driver.DB2NetDriver" , SetupDB2 } ,
35
38
#if NETFX
36
39
{ "NHibernate.Driver.SqlServerCeDriver" , SetupSqlServerCe } ,
37
40
{ "NHibernate.Driver.SapSQLAnywhere17Driver" , SetupSqlAnywhere }
@@ -207,6 +210,10 @@ private static void SetupSQLite(Cfg.Configuration cfg)
207
210
}
208
211
}
209
212
213
+ private static void SetupDB2 ( Cfg . Configuration cfg )
214
+ {
215
+ }
216
+
210
217
private static void SetupOracle ( Cfg . Configuration cfg )
211
218
{
212
219
// disabled until system password is set on TeamCity
Original file line number Diff line number Diff line change @@ -214,6 +214,8 @@ public override bool SupportsSequences
214
214
get { return true ; }
215
215
}
216
216
217
+ public override string QuerySequencesString => "select seqname from syscat.sequences" ;
218
+
217
219
/// <summary></summary>
218
220
public override bool SupportsLimit
219
221
{
@@ -311,6 +313,9 @@ public override string ForUpdateString
311
313
312
314
public override bool SupportsExistsInSelect => false ;
313
315
316
+ /// <inheritdoc/>
317
+ public override bool SupportsHavingOnGroupedByComputation => false ;
318
+
314
319
public override bool DoesReadCommittedCauseWritersToBlockReaders => true ;
315
320
316
321
#endregion
Original file line number Diff line number Diff line change 1
- using System . Data . Common ;
2
- using NHibernate . SqlTypes ;
1
+ using System ;
3
2
4
3
namespace NHibernate . Driver
5
4
{
6
5
/// <summary>
7
6
/// A NHibernate Driver for using the IBM.Data.DB2.Core DataProvider.
8
7
/// </summary>
9
- public class DB2CoreDriver : DB2DriverBase
10
- {
11
- public DB2CoreDriver ( ) : base ( "IBM.Data.DB2.Core" )
12
- {
13
- }
8
+ // Since v5.6
9
+ [ Obsolete ( "Please use DB2NetDriver" ) ]
10
+ public class DB2CoreDriver : DB2NetDriver
11
+ {
12
+ private static readonly INHibernateLogger Log = NHibernateLogger . For ( typeof ( DB2CoreDriver ) ) ;
14
13
15
- public override bool UseNamedPrefixInSql => true ;
16
-
17
- public override bool UseNamedPrefixInParameter => true ;
18
-
19
- public override string NamedPrefix => "@" ;
20
-
21
- protected override void InitializeParameter ( DbParameter dbParam , string name , SqlType sqlType )
14
+ public DB2CoreDriver ( ) : base ( "IBM.Data.DB2.Core" )
22
15
{
23
- dbParam . ParameterName = FormatNameForParameter ( name ) ;
24
- base . InitializeParameter ( dbParam , name , sqlType ) ;
16
+ Log . Warn ( "DB2CoreDriver is obsolete, please use DB2NetDriver instead." ) ;
25
17
}
26
18
}
27
19
}
Original file line number Diff line number Diff line change
1
+ using System . Data . Common ;
2
+ using NHibernate . SqlTypes ;
3
+
4
+ namespace NHibernate . Driver
5
+ {
6
+ /// <summary>
7
+ /// A NHibernate Driver for using the Net5.IBM.Data.Db2/Net.IBM.Data.Db2 DataProvider.
8
+ /// </summary>
9
+ public class DB2NetDriver : DB2DriverBase
10
+ {
11
+ private protected DB2NetDriver ( string assemblyName ) : base ( assemblyName )
12
+ {
13
+ }
14
+
15
+ public DB2NetDriver ( ) : base ( "IBM.Data.Db2" )
16
+ {
17
+ }
18
+
19
+ public override bool UseNamedPrefixInSql => true ;
20
+ public override bool UseNamedPrefixInParameter => true ;
21
+ public override string NamedPrefix => "@" ;
22
+
23
+ protected override void InitializeParameter ( DbParameter dbParam , string name , SqlType sqlType )
24
+ {
25
+ dbParam . ParameterName = FormatNameForParameter ( name ) ;
26
+ base . InitializeParameter ( dbParam , name , sqlType ) ;
27
+ }
28
+ }
29
+ }
You can’t perform that action at this time.
0 commit comments