SPRNET-1408 - Add data providers in System.Data.dll to be accessed via Spring's IDbProvider interface.
This commit is contained in:
@@ -87,6 +87,47 @@
|
||||
|
||||
</object>
|
||||
|
||||
<object id="SqlServer-4.0" type="Spring.Data.Common.DbProvider, Spring.Data" singleton="false">
|
||||
<constructor-arg name="dbMetaData">
|
||||
<object type="Spring.Data.Common.DbMetadata">
|
||||
<constructor-arg name="productName" value="Microsoft SQL Server, provider V4.0.0.0 in framework .NET V4.0" />
|
||||
<constructor-arg name="assemblyName" value="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<constructor-arg name="connectionType" value="System.Data.SqlClient.SqlConnection, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<constructor-arg name="commandType" value="System.Data.SqlClient.SqlCommand, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<constructor-arg name="parameterType" value="System.Data.SqlClient.SqlParameter, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<constructor-arg name="dataAdapterType" value="System.Data.SqlClient.SqlDataAdapter, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<constructor-arg name="commandBuilderType" value="System.Data.SqlClient.SqlCommandBuilder, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<constructor-arg name="commandBuilderDeriveParametersMethod" value="DeriveParameters"/>
|
||||
<constructor-arg name="parameterDbType" value="System.Data.SqlDbType, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<constructor-arg name="parameterDbTypeProperty" value="SqlDbType"/>
|
||||
<constructor-arg name="parameterIsNullableProperty" value="IsNullable"/>
|
||||
<constructor-arg name="parameterNamePrefix" value="@"/>
|
||||
<constructor-arg name="exceptionType" value="System.Data.SqlClient.SqlException, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<constructor-arg name="useParameterNamePrefixInParameterCollection" value="true"/>
|
||||
<constructor-arg name="useParameterPrefixInSql" value="true"/>
|
||||
<constructor-arg name="bindByName" value="true"/>
|
||||
<!-- this is only true for .net 1.1 kept it here just in case we want to revert back to this strategy for
|
||||
obtaining error codes-->
|
||||
<constructor-arg name="errorCodeExceptionExpression" value="Errors[0].Number.ToString()"/>
|
||||
|
||||
<!-- TODO select form system db all errors that have 'incorrect syntax' at the start of the error string-->
|
||||
<property name="ErrorCodes.BadSqlGrammarCodes">
|
||||
<value>156,170,207,208</value>
|
||||
</property>
|
||||
<property name="ErrorCodes.PermissionDeniedCodes">
|
||||
<value>229</value>
|
||||
</property>
|
||||
<property name="ErrorCodes.DataIntegrityViolationCodes">
|
||||
<value>544,2627,8114,8115</value>
|
||||
</property>
|
||||
<property name="ErrorCodes.DeadlockLoserCodes">
|
||||
<value>1205</value>
|
||||
</property>
|
||||
</object>
|
||||
</constructor-arg>
|
||||
|
||||
</object>
|
||||
|
||||
<alias name="SqlServer-2.0" alias="System.Data.SqlClient"/>
|
||||
|
||||
|
||||
@@ -257,6 +298,48 @@
|
||||
|
||||
</object>
|
||||
|
||||
<object id="OleDb-4.0" type="Spring.Data.Common.DbProvider, Spring.Data" singleton="false">
|
||||
<constructor-arg name="dbMetaData">
|
||||
<object type="Spring.Data.Common.DbMetadata">
|
||||
<constructor-arg name="productName" value="OleDb, provider V4.0.0.0 in framework .NET V4"/>
|
||||
<constructor-arg name="assemblyName" value="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<constructor-arg name="connectionType" value="System.Data.OleDb.OleDbConnection, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<constructor-arg name="commandType" value="System.Data.OleDb.OleDbCommand, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<constructor-arg name="parameterType" value="System.Data.OleDb.OleDbParameter, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<constructor-arg name="dataAdapterType" value="System.Data.OleDb.OleDbDataAdapter, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<constructor-arg name="commandBuilderType" value="System.Data.OleDb.OleDbCommandBuilder, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<constructor-arg name="commandBuilderDeriveParametersMethod" value="DeriveParameters"/>
|
||||
<constructor-arg name="parameterDbType" value="System.Data.OleDb.OleDbType, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<constructor-arg name="parameterDbTypeProperty" value="OleDbType"/>
|
||||
<constructor-arg name="parameterIsNullableProperty" value="IsNullable"/>
|
||||
<constructor-arg name="parameterNamePrefix" value="?"/>
|
||||
<constructor-arg name="exceptionType" value="System.Data.OleDb.OleDbException, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<constructor-arg name="useParameterNamePrefixInParameterCollection" value="false"/>
|
||||
<constructor-arg name="useParameterPrefixInSql" value="false"/>
|
||||
<constructor-arg name="bindByName" value="false"/>
|
||||
<!-- TODO should parse out high/low values in the native error...yuk!-->
|
||||
<constructor-arg name="errorCodeExceptionExpression" value="Errors[0].NativeError.ToString()"/>
|
||||
|
||||
<!-- TODO where is the definitive list of the error. Anyway, until parse out high low error there isn't any
|
||||
exception mapping yet for this provider.
|
||||
-->
|
||||
<property name="ErrorCodes.BadSqlGrammarCodes">
|
||||
<value>156,170,207,208</value>
|
||||
</property>
|
||||
<property name="ErrorCodes.PermissionDeniedCodes">
|
||||
<value>229</value>
|
||||
</property>
|
||||
<property name="ErrorCodes.DataIntegrityViolationCodes">
|
||||
<value>2627,8114,8115</value>
|
||||
</property>
|
||||
<property name="ErrorCodes.DeadlockLoserCodes">
|
||||
<value>1205</value>
|
||||
</property>
|
||||
</object>
|
||||
</constructor-arg>
|
||||
|
||||
</object>
|
||||
|
||||
<alias name="OleDb-2.0" alias="System.Data.OleDb"/>
|
||||
|
||||
|
||||
@@ -1898,6 +1981,31 @@
|
||||
|
||||
</object>
|
||||
|
||||
<object id="Odbc-4.0" type="Spring.Data.Common.DbProvider, Spring.Data" singleton="false">
|
||||
<constructor-arg name="dbMetaData">
|
||||
<object type="Spring.Data.Common.DbMetadata">
|
||||
<constructor-arg name="productName" value="Microsoft ODBC, provider V4.0.0.0 in framework .NET V4"/>
|
||||
<constructor-arg name="assemblyName" value="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<constructor-arg name="connectionType" value="System.Data.Odbc.OdbcConnection, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<constructor-arg name="commandType" value="System.Data.Odbc.OdbcCommand, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<constructor-arg name="parameterType" value="System.Data.Odbc.OdbcParameter, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<constructor-arg name="dataAdapterType" value="System.Data.Odbc.OdbcDataAdapter, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<constructor-arg name="commandBuilderType" value="System.Data.Odbc.OdbcCommandBuilder, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<constructor-arg name="commandBuilderDeriveParametersMethod" value="DeriveParameters"/>
|
||||
<constructor-arg name="parameterDbType" value="System.Data.Odbc.OdbcType, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<constructor-arg name="parameterDbTypeProperty" value="OdbcType"/>
|
||||
<constructor-arg name="parameterIsNullableProperty" value="IsNullable"/>
|
||||
<constructor-arg name="parameterNamePrefix" value="?"/>
|
||||
<constructor-arg name="exceptionType" value="System.Data.Odbc.OdbcException, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
|
||||
<constructor-arg name="useParameterNamePrefixInParameterCollection" value="false"/>
|
||||
<constructor-arg name="useParameterPrefixInSql" value="false"/>
|
||||
<constructor-arg name="bindByName" value="false"/>
|
||||
<constructor-arg name="errorCodeExceptionExpression" value="Errors[0].NativeError.ToString()"/>
|
||||
</object>
|
||||
</constructor-arg>
|
||||
|
||||
</object>
|
||||
|
||||
<alias name="Odbc-2.0" alias="System.Data.Odbc"/>
|
||||
|
||||
<object id="Cache-2.0.0.1" type="Spring.Data.Common.DbProvider, Spring.Data" singleton="false">
|
||||
|
||||
@@ -96,17 +96,15 @@ namespace Spring.Data
|
||||
object QueryWithResultSetExtractor(CommandType cmdType, string cmdText, IResultSetExtractor resultSetExtractor);
|
||||
|
||||
|
||||
// Parameterized Queries
|
||||
|
||||
|
||||
//only input parameters can be used...
|
||||
// Parameterized Queries
|
||||
// Only input parameters can be used...
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Execute a query given IDbCommand's type and text with parameters set
|
||||
/// Execute a query given the CommandType and text with parameters set
|
||||
/// via the command setter, processing a
|
||||
/// single result set with an instance of IResultSetExtractor
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
/// <param name="cmdType">The command type.</param>
|
||||
/// <param name="cmdText">The command text to execute.</param>
|
||||
/// <param name="resultSetExtractor">The result set extractor.</param>
|
||||
@@ -114,16 +112,43 @@ namespace Spring.Data
|
||||
/// <returns>An arbitrary result object, as returned by the IResultSetExtractor</returns>
|
||||
/// <exception cref="Spring.Dao.DataAccessException">
|
||||
/// If there is any problem executing the query.
|
||||
/// </exception>
|
||||
/// </exception>
|
||||
object QueryWithResultSetExtractor(CommandType cmdType, string cmdText, IResultSetExtractor resultSetExtractor,
|
||||
ICommandSetter commandSetter);
|
||||
|
||||
//only input parameters can be used.
|
||||
object QueryWithResultSetExtractor(CommandType commandType, string cmdText, IResultSetExtractor resultSetExtractor,
|
||||
string parameterName, Enum dbType, int size, object parameterValue);
|
||||
|
||||
//iterate over one or more result sets and then assign output parameters.
|
||||
object QueryWithResultSetExtractor(CommandType commandType, string cmdText, IResultSetExtractor resultSetExtractor,
|
||||
/// <summary>
|
||||
/// Execute a query given the CommandType and text specifying a single parameter and process a single result set with an
|
||||
/// instance of IResultSetExtractor.
|
||||
/// </summary>
|
||||
/// <remarks>Convention is to use 0 For the size if it does not make sense for the given data type
|
||||
/// </remarks>
|
||||
/// <param name="cmdType">The command type.</param>
|
||||
/// <param name="cmdText">The command text to execute.</param>
|
||||
/// <param name="resultSetExtractor">The result set extractor.</param>
|
||||
/// <param name="parameterName">The name of the parameters</param>
|
||||
/// <param name="dbType">The enumeration of the parameter type </param>
|
||||
/// <param name="size">The size of the parmeter - e.g. string length. Use 0 if not relevant for specific data type</param>
|
||||
/// <param name="parameterValue">The value of the parameters</param>
|
||||
/// <returns>An arbitrary result object, as returned by the IResultSetExtractor</returns>
|
||||
/// <exception cref="Spring.Dao.DataAccessException">
|
||||
/// If there is any problem executing the query.
|
||||
/// </exception>
|
||||
object QueryWithResultSetExtractor(CommandType cmdType, string cmdText, IResultSetExtractor resultSetExtractor,
|
||||
string parameterName, Enum dbType, int size, object parameterValue);
|
||||
|
||||
/// <summary>
|
||||
/// Execute a query given the CommandType and text specifying a collection of parameters and process a single result set with an
|
||||
/// instance of IResultSetExtractor.
|
||||
/// </summary>
|
||||
/// <param name="cmdType">The command type.</param>
|
||||
/// <param name="cmdText">The command text to execute.</param>
|
||||
/// <param name="resultSetExtractor">The result set extractor.</param>
|
||||
/// <param name="parameters">The query parameters</param>
|
||||
/// <returns>An arbitrary result object, as returned by the IResultSetExtractor</returns>
|
||||
/// <exception cref="Spring.Dao.DataAccessException">
|
||||
/// If there is any problem executing the query.
|
||||
/// </exception>
|
||||
object QueryWithResultSetExtractor(CommandType cmdType, string cmdText, IResultSetExtractor resultSetExtractor,
|
||||
IDbParameters parameters);
|
||||
|
||||
|
||||
@@ -138,8 +163,8 @@ namespace Spring.Data
|
||||
/// and process a single result set with an instance of ResultSetExtractorDelegate
|
||||
/// </summary>
|
||||
/// <param name="cmdType">The type of command.</param>
|
||||
/// <param name="cmdText">The command text.</param>
|
||||
/// <param name="resultSetExtractorDelegate">Delegate that will extract all rows of a result set</param>
|
||||
/// <param name="cmdText">The command text.</param>
|
||||
/// <param name="resultSetExtractorDelegate">Delegate that will process all rows of a result set</param>
|
||||
/// <returns>An arbitrary result object, as returned by the IResultSetExtractor</returns>
|
||||
/// <exception cref="Spring.Dao.DataAccessException">
|
||||
/// If there is any problem executing the query.
|
||||
@@ -148,25 +173,73 @@ namespace Spring.Data
|
||||
|
||||
|
||||
// Parameterized Queries
|
||||
|
||||
|
||||
//only input parameters can be used...
|
||||
object QueryWithResultSetExtractorDelegate(CommandType commandType, string sql, ResultSetExtractorDelegate resultSetExtractorDelegate,
|
||||
ICommandSetter commandSetter);
|
||||
|
||||
//only input parameters can be used.
|
||||
object QueryWithResultSetExtractorDelegate(CommandType commandType, string sql, ResultSetExtractorDelegate resultSetExtractorDelegate,
|
||||
string parameterName, Enum dbType, int size, object parameterValue);
|
||||
|
||||
//iterate over one or more result sets and then assign output parameters.
|
||||
object QueryWithResultSetExtractorDelegate(CommandType commandType, string sql, ResultSetExtractorDelegate resultSetExtractorDelegate,
|
||||
IDbParameters parameter);
|
||||
// only input parameters can be used...
|
||||
|
||||
/// <summary>
|
||||
/// Execute a query given the CommandType and text with parameters set
|
||||
/// via the command setter, processing a
|
||||
/// single result set with an instance of IResultSetExtractor
|
||||
/// </summary>
|
||||
/// <param name="cmdType">The command type.</param>
|
||||
/// <param name="cmdText">The command text to execute.</param>
|
||||
/// <param name="resultSetExtractorDelegate">Delegate that will process all rows of a result set</param>
|
||||
/// <param name="commandSetter">The command setter.</param>
|
||||
/// <returns>An arbitrary result object, as returned by the IResultSetExtractor</returns>
|
||||
/// <exception cref="Spring.Dao.DataAccessException">
|
||||
/// If there is any problem executing the query.
|
||||
/// </exception>
|
||||
object QueryWithResultSetExtractorDelegate(CommandType cmdType, string cmdText, ResultSetExtractorDelegate resultSetExtractorDelegate,
|
||||
ICommandSetter commandSetter);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Execute a query given the CommandType and text specifying a single parameter and process a single result set with an
|
||||
/// instance of IResultSetExtractor.
|
||||
/// </summary>
|
||||
/// <remarks>Convention is to use 0 For the size if it does not make sense for the given data type
|
||||
/// </remarks>
|
||||
/// <param name="cmdType">The command type.</param>
|
||||
/// <param name="cmdText">The command text to execute.</param>
|
||||
/// <param name="resultSetExtractorDelegate">Delegate that will process all rows of a result set</param>
|
||||
/// <param name="parameterName">The name of the parameters</param>
|
||||
/// <param name="dbType">The enumeration of the parameter type </param>
|
||||
/// <param name="size">The size of the parmeter - e.g. string length. Use 0 if not relevant for specific data type</param>
|
||||
/// <param name="parameterValue">The value of the parameters</param>
|
||||
/// <returns>An arbitrary result object, as returned by the IResultSetExtractor</returns>
|
||||
/// <exception cref="Spring.Dao.DataAccessException">
|
||||
/// If there is any problem executing the query.
|
||||
/// </exception>
|
||||
object QueryWithResultSetExtractorDelegate(CommandType cmdType, string cmdText, ResultSetExtractorDelegate resultSetExtractorDelegate,
|
||||
string parameterName, Enum dbType, int size, object parameterValue);
|
||||
|
||||
/// <summary>
|
||||
/// Execute a query given the CommandType and text specifying a collection of parameters and process a single result set with an
|
||||
/// instance of IResultSetExtractor.
|
||||
/// </summary>
|
||||
/// <param name="cmdType">The command type.</param>
|
||||
/// <param name="cmdText">The command text to execute.</param>
|
||||
/// <param name="resultSetExtractorDelegate">Delegate that will process all rows of a result set</param>
|
||||
/// <param name="parameters">The query parameters</param>
|
||||
/// <returns>An arbitrary result object, as returned by the IResultSetExtractor</returns>
|
||||
/// <exception cref="Spring.Dao.DataAccessException">
|
||||
/// If there is any problem executing the query.
|
||||
/// </exception>
|
||||
object QueryWithResultSetExtractorDelegate(CommandType cmdType, string cmdText, ResultSetExtractorDelegate resultSetExtractorDelegate,
|
||||
IDbParameters parameters);
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Queries with RowMapperDelegate
|
||||
|
||||
#region Queries with RowMapperDelegate
|
||||
|
||||
/// <summary>
|
||||
/// Execute a query given static SQL, mapping each row to a .NET object
|
||||
/// via a RowMapper
|
||||
/// </summary>
|
||||
/// <param name="cmdType">The type of command</param>
|
||||
/// <param name="cmdText">SQL query to execute</param>
|
||||
/// <param name="rowMapperDelgate">delegate/lambda that will map one object per row</param>
|
||||
/// <returns>The result list containing mapped objects</returns>
|
||||
IList QueryWithRowMapperDelegate(CommandType cmdType, string cmdText, RowMapperDelegate rowMapperDelgate);
|
||||
|
||||
IList QueryWithRowMapperDelegate(CommandType cmdType, string cmdText, RowMapperDelegate rowMapperDelgate, ICommandSetter commandSetter);
|
||||
@@ -186,7 +259,7 @@ namespace Spring.Data
|
||||
|
||||
/// <summary>
|
||||
/// Execute a query given static SQL, mapping each row to a .NET object
|
||||
/// iva a RowMapper
|
||||
/// via a RowMapper
|
||||
/// </summary>
|
||||
/// <param name="cmdType">The type of command</param>
|
||||
/// <param name="cmdText">SQL query to execute</param>
|
||||
|
||||
Reference in New Issue
Block a user