You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ibatis.apache.org by gb...@apache.org on 2005/05/25 21:42:41 UTC

svn commit: r178521 - /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess/Configuration /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration

Author: gbayon
Date: Wed May 25 12:42:41 2005
New Revision: 178521

URL: http://svn.apache.org/viewcvs?rev=178521&view=rev
Log:
- Fixed Jira-9 also for DataAccess

Modified:
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess/Configuration/DomDaoManagerBuilder.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapConfig.xsd

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess/Configuration/DomDaoManagerBuilder.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess/Configuration/DomDaoManagerBuilder.cs?rev=178521&r1=178520&r2=178521&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess/Configuration/DomDaoManagerBuilder.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess/Configuration/DomDaoManagerBuilder.cs Wed May 25 12:42:41 2005
@@ -62,6 +62,11 @@
 		public const string DEFAULT_DAOSESSIONHANDLER_NAME = "DEFAULT_DAOSESSIONHANDLER_NAME";
 
 		/// <summary>
+		/// Token for xml path to SqlMapConfig providers element.
+		/// </summary>
+		private static string XML_CONFIG_PROVIDERS = "/sqlMapConfig/providers";
+
+		/// <summary>
 		/// Token for providers config file name.
 		/// </summary>
 		private const string PROVIDERS_FILE_NAME = "providers.config";
@@ -120,11 +125,20 @@
 		{
 			XmlSerializer serializer = null;
 			Provider provider = null;
-			string directoryName = string.Empty;
+			XmlDocument xmlProviders = null;
 
 			configurationScope.ErrorContext.Activity = "load DataBase Provider";
 
-			XmlDocument xmlProviders = Resources.GetConfigAsXmlDocument(PROVIDERS_FILE_NAME);
+			XmlNode providersNode = null;
+			providersNode = configurationScope.DaoConfigDocument.SelectSingleNode(XML_CONFIG_PROVIDERS);
+			if (providersNode != null )
+			{
+				xmlProviders = Resources.GetAsXmlDocument( providersNode, configurationScope.Properties );
+			}
+			else
+			{
+				xmlProviders = Resources.GetConfigAsXmlDocument(PROVIDERS_FILE_NAME);
+			}
 
 			serializer = new XmlSerializer(typeof(Provider));
 

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config?rev=178521&r1=178520&r2=178521&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config Wed May 25 12:42:41 2005
@@ -22,7 +22,7 @@
 		<!-- To test MySql via MySql provider value="MySql"  -->
 		<!-- To test via OleDb provider (any database) value="OleDb"  -->
 		<!-- To test via Odbc provider (any database) value="Odbc"  -->
-		<add key="providerType" value="OleDb"/>
+		<add key="providerType" value="SqlClient"/>
 	</appSettings>
 	
 	<!-- This section contains the log4net configuration settings -->

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs?rev=178521&r1=178520&r2=178521&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs Wed May 25 12:42:41 2005
@@ -504,16 +504,14 @@
 
 			XmlNode providersNode = null;
 			providersNode = _configScope.SqlMapConfigDocument.SelectSingleNode(XML_CONFIG_PROVIDERS);
-			if (providersNode == null )
+			if (providersNode != null )
 			{
-				throw new ConfigurationException("The providers tag is required in sqlmap.config.");
+				xmlProviders = Resources.GetAsXmlDocument( providersNode, _configScope.Properties );
 			}
 			else
 			{
-				xmlProviders = Resources.GetAsXmlDocument( providersNode, _configScope.Properties );
+				xmlProviders = Resources.GetConfigAsXmlDocument(PROVIDERS_FILE_NAME);
 			}
-
-			xmlProviders = Resources.GetConfigAsXmlDocument(PROVIDERS_FILE_NAME);
 
 			serializer = new XmlSerializer(typeof(Provider));
 

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapConfig.xsd
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapConfig.xsd?rev=178521&r1=178520&r2=178521&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapConfig.xsd (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapConfig.xsd Wed May 25 12:42:41 2005
@@ -62,11 +62,19 @@
 			<xs:attribute name="embedded" type="xs:string"/>
 		</xs:complexType>
 	</xs:element>
+	<xs:element name="providers">
+		<xs:complexType>
+			<xs:attribute name="resource" type="xs:string"/>
+			<xs:attribute name="url" type="xs:string"/>
+			<xs:attribute name="embedded" type="xs:string"/>
+		</xs:complexType>
+	</xs:element>
 	<xs:element name="sqlMapConfig">
 		<xs:complexType>
 			<xs:sequence>
 				<xs:element ref="settings" minOccurs="0" maxOccurs="1"/>
 				<xs:element ref="properties" minOccurs="0" maxOccurs="1"/>
+				<xs:element ref="providers" minOccurs="0" maxOccurs="1"/>
 				<xs:element ref="database" minOccurs="0" maxOccurs="1"/>
 				<xs:element ref="alias" minOccurs="0" maxOccurs="1"/>
 				<xs:element ref="typeHandlers" minOccurs="0" maxOccurs="1"/>