File tree Expand file tree Collapse file tree 6 files changed +71
-17
lines changed
NHibernate.TestDatabaseSetup Expand file tree Collapse file tree 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)
123123 /// </summary>
124124 public virtual bool SupportsModuloOnDecimal => true ;
125125
126+ /// <summary>
127+ /// Supports sub-selects in order by clause
128+ /// </summary>
129+ public virtual bool SupportsSubSelectsInOrderBy => _dialect . SupportsScalarSubSelects ;
130+
126131 /// <summary>
127132 /// Supports aggregating sub-selects in order by clause
128133 /// </summary>
129- public virtual bool SupportsAggregatingScalarSubSelectsInOrderBy => _dialect . SupportsScalarSubSelects ;
134+ public virtual bool SupportsAggregatingScalarSubSelectsInOrderBy => SupportsSubSelectsInOrderBy ;
130135
131136 /// <summary>
132137 /// 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
3232 { "NHibernate.Driver.OracleManagedDataClientDriver" , SetupOracle } ,
3333 { "NHibernate.Driver.OdbcDriver" , SetupSqlServerOdbc } ,
3434 { "NHibernate.Driver.SQLite20Driver" , SetupSQLite } ,
35+ { "NHibernate.Driver.DB2Driver" , SetupDB2 } ,
36+ { "NHibernate.Driver.DB2CoreDriver" , SetupDB2 } ,
37+ { "NHibernate.Driver.DB2NetDriver" , SetupDB2 } ,
3538#if NETFX
3639 { "NHibernate.Driver.SqlServerCeDriver" , SetupSqlServerCe } ,
3740 { "NHibernate.Driver.SapSQLAnywhere17Driver" , SetupSqlAnywhere }
@@ -207,6 +210,10 @@ private static void SetupSQLite(Cfg.Configuration cfg)
207210 }
208211 }
209212
213+ private static void SetupDB2 ( Cfg . Configuration cfg )
214+ {
215+ }
216+
210217 private static void SetupOracle ( Cfg . Configuration cfg )
211218 {
212219 // 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
214214 get { return true ; }
215215 }
216216
217+ public override string QuerySequencesString => "select seqname from syscat.sequences" ;
218+
217219 /// <summary></summary>
218220 public override bool SupportsLimit
219221 {
@@ -311,6 +313,9 @@ public override string ForUpdateString
311313
312314 public override bool SupportsExistsInSelect => false ;
313315
316+ /// <inheritdoc/>
317+ public override bool SupportsHavingOnGroupedByComputation => false ;
318+
314319 public override bool DoesReadCommittedCauseWritersToBlockReaders => true ;
315320
316321 #endregion
Original file line number Diff line number Diff line change 1- using System . Data . Common ;
2- using NHibernate . SqlTypes ;
1+ using System ;
32
43namespace NHibernate . Driver
54{
65 /// <summary>
76 /// A NHibernate Driver for using the IBM.Data.DB2.Core DataProvider.
87 /// </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 ) ) ;
1413
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" )
2215 {
23- dbParam . ParameterName = FormatNameForParameter ( name ) ;
24- base . InitializeParameter ( dbParam , name , sqlType ) ;
16+ Log . Warn ( "DB2CoreDriver is obsolete, please use DB2NetDriver instead." ) ;
2517 }
2618 }
2719}
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