Skip to content

Commit 2dc84fe

Browse files
author
Sergey Koshcheyev
committed
Move SupportsMultipleQueries from Dialect to Driver since that appears to be a more appropriate place.
SVN: trunk@2633
1 parent 49bebc4 commit 2dc84fe

File tree

8 files changed

+25
-29
lines changed

8 files changed

+25
-29
lines changed

src/NHibernate/Dialect/Dialect.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,6 @@ public virtual bool QualifyIndexName
204204
{
205205
get { return true; }
206206
}
207-
208-
/// <summary>
209-
/// Can we issue several select queries in a single query, and get
210-
/// several result sets back?
211-
/// </summary>
212-
public virtual bool SupportsMultipleQueries
213-
{
214-
get { return false; }
215-
}
216207

217208
/// <summary>
218209
/// How we seperate the queries when we use multiply queries.

src/NHibernate/Dialect/MsSql2000Dialect.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,6 @@ public override string GetDropTableString(string tableName)
182182

183183
return String.Format( dropTable, tableName );
184184
}
185-
186-
public override bool SupportsMultipleQueries
187-
{
188-
get
189-
{
190-
return true;
191-
}
192-
}
193185

194186
public override string ForUpdateString
195187
{

src/NHibernate/Dialect/MsSqlCeDialect.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace NHibernate.Dialect
88
{
99
/// <summary>
10-
/// A dialect for SQL Server Everywhere.
10+
/// A dialect for SQL Server Everywhere (SQL Server CE).
1111
/// </summary>
1212
public class MsSqlCeDialect : Dialect
1313
{
@@ -59,14 +59,6 @@ public override bool QualifyIndexName
5959
get { return false; }
6060
}
6161

62-
public override bool SupportsMultipleQueries
63-
{
64-
get
65-
{
66-
return true;
67-
}
68-
}
69-
7062
public override string ForUpdateString
7163
{
7264
get { return string.Empty; }

src/NHibernate/Driver/DriverBase.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,5 +236,10 @@ public IDbDataParameter GenerateOutputParameter(IDbCommand command)
236236
param.Direction = ParameterDirection.Output;
237237
return param;
238238
}
239+
240+
public virtual bool SupportsMultipleQueries
241+
{
242+
get { return false; }
243+
}
239244
}
240245
}

src/NHibernate/Driver/IDriver.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ public interface IDriver
6161
/// </remarks>
6262
bool SupportsMultipleOpenReaders { get; }
6363

64+
/// <summary>
65+
/// Can we issue several select queries in a single query, and get
66+
/// several result sets back?
67+
/// </summary>
68+
bool SupportsMultipleQueries { get; }
69+
6470
/// <summary>
6571
/// Generates an IDbCommand from the SqlString according to the requirements of the DataProvider.
6672
/// </summary>

src/NHibernate/Driver/SqlClientDriver.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,5 +175,10 @@ public override IDbCommand GenerateCommand(CommandType type, SqlString sqlString
175175
}
176176
return command;
177177
}
178+
179+
public override bool SupportsMultipleQueries
180+
{
181+
get { return true; }
182+
}
178183
}
179184
}

src/NHibernate/Driver/SqlServerCeDriver.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
namespace NHibernate.Driver
99
{
1010
/// <summary>
11-
/// A NHibernate Driver for using the SqlClient DataProvider
11+
/// A NHibernate driver for Microsoft SQL Server CE data provider
1212
/// </summary>
1313
public class SqlServerCeDriver : ReflectionBasedDriver
1414
{
1515
/// <summary>
16-
/// Initializes a new instance of the <see cref="SqlClientDriver"/> class.
16+
/// Initializes a new instance of the <see cref="SqlServerCeDriver"/> class.
1717
/// </summary>
1818
public SqlServerCeDriver()
1919
: base(
@@ -89,5 +89,10 @@ public override IDbCommand GenerateCommand(CommandType type, SqlString sqlString
8989

9090
return command;
9191
}
92+
93+
public override bool SupportsMultipleQueries
94+
{
95+
get { return true; }
96+
}
9297
}
9398
}

src/NHibernate/Impl/MultiQueryImpl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class MultiQueryImpl : IMultiQuery
4040
public MultiQueryImpl(ISessionImplementor session)
4141
{
4242
dialect = session.Factory.Dialect;
43-
if (dialect.SupportsMultipleQueries == false)
43+
if (!session.Factory.ConnectionProvider.Driver.SupportsMultipleQueries)
4444
{
4545
throw new NotSupportedException(
4646
string.Format("The dialect {0} does not support multiple queries.", dialect.GetType().FullName));

0 commit comments

Comments
 (0)