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/28 14:30:02 UTC
svn commit: r178868 - in
/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper:
Configuration/DomSqlMapBuilder.cs Scope/ConfigurationScope.cs SqlMapper.cs
Author: gbayon
Date: Sat May 28 05:30:01 2005
New Revision: 178868
URL: http://svn.apache.org/viewcvs?rev=178868&view=rev
Log:
- Updated comments on API
Modified:
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Scope/ConfigurationScope.cs
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapper.cs
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=178868&r1=178867&r2=178868&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs Sat May 28 05:30:01 2005
@@ -28,6 +28,7 @@
using System;
using System.Collections;
+using System.Collections.Specialized;
using System.IO;
using System.Reflection;
using System.Text;
@@ -162,6 +163,7 @@
return Configure( Resources.GetConfigAsXmlDocument(DomSqlMapBuilder.DEFAULT_FILE_CONFIG_NAME) );
}
+
/// <summary>
/// Configure an SqlMap.
/// </summary>
@@ -172,11 +174,13 @@
return Build( document, false );
}
+
/// <summary>
- /// Configure an SqlMap from via a relative ressource path.
+ /// Configure an SqlMap from a file path.
/// </summary>
/// <param name="resource">
- /// A relative ressource path from your Application root.
+ /// A relative ressource path from your Application root
+ /// or a absolue file path file:\\c:\dir\a.config
/// </param>
/// <returns>An SqlMap</returns>
public SqlMapper Configure(string resource)
@@ -193,8 +197,9 @@
return Build( document, false);
}
+
/// <summary>
- /// Configure an SqlMap from via a stream.
+ /// Configure an SqlMap from a stream.
/// </summary>
/// <param name="resource">A stream resource</param>
/// <returns>An SqlMap</returns>
@@ -204,8 +209,9 @@
return Build( document, false);
}
+
/// <summary>
- /// Configure an SqlMap from via a FileInfo.
+ /// Configure an SqlMap from a FileInfo.
/// </summary>
/// <param name="resource">A FileInfo resource</param>
/// <returns>An SqlMap</returns>
@@ -215,8 +221,9 @@
return Build( document, false);
}
+
/// <summary>
- /// Configure an SqlMap from via an Uri.
+ /// Configure an SqlMap from an Uri.
/// </summary>
/// <param name="resource">A Uri resource</param>
/// <returns></returns>
@@ -226,6 +233,7 @@
return Build( document, false);
}
+
/// <summary>
/// Configure and monitor the default configuration file for modifications
/// and automatically reconfigure SqlMap.
@@ -236,12 +244,14 @@
return ConfigureAndWatch( DEFAULT_FILE_CONFIG_NAME, configureDelegate ) ;
}
+
/// <summary>
/// Configure and monitor the configuration file for modifications
/// and automatically reconfigure SqlMap.
/// </summary>
/// <param name="resource">
- /// A relative ressource path from your Application root.
+ /// A relative ressource path from your Application root
+ /// or an absolue file path file:\\c:\dir\a.config
/// </param>
///<param name="configureDelegate">
/// Delegate called when the file has changed, to rebuild the dal.
@@ -273,12 +283,13 @@
return Build( document, true );
}
+
/// <summary>
/// Configure and monitor the configuration file for modifications
/// and automatically reconfigure SqlMap.
/// </summary>
/// <param name="resource">
- /// A relative ressource path from your Application root.
+ /// A FileInfo to your config file.
/// </param>
///<param name="configureDelegate">
/// Delegate called when the file has changed, to rebuild the dal.
@@ -302,6 +313,7 @@
return Build( document, true );
}
+
/// <summary>
/// Callback called when the SqlMap.config changed.
/// </summary>
@@ -311,9 +323,8 @@
StateConfig state = (StateConfig)obj;
state.ConfigureHandler( null );
}
- #endregion
-
+ #endregion
#region Methods
@@ -333,7 +344,6 @@
_configScope.DataSource = dataSource;
_configScope.IsCallFromDao = isCallFromDao;
_configScope.UseConfigFileWatcher = useConfigFileWatcher;
-
try
{
@@ -347,6 +357,7 @@
}
}
+
/// <summary>
/// validate againts schema
/// </summary>
@@ -391,6 +402,7 @@
}
}
+
private void ValidationCallBack( object sender, ValidationEventArgs args )
{
_configScope.IsXmlValid = false;
@@ -399,10 +411,16 @@
/// <summary>
/// Load statement, parameters, resultmap.
- /// Used by Dao
/// </summary>
- public SqlMapper Build(XmlDocument document, DataSource dataSource, bool useConfigFileWatcher)
+ /// <param name="document"></param>
+ /// <param name="dataSource"></param>
+ /// <param name="useConfigFileWatcher"></param>
+ /// <param name="properties"></param>
+ /// <returns></returns>
+ /// <remarks>Used by Dao</remarks>
+ public SqlMapper Build(XmlDocument document, DataSource dataSource, bool useConfigFileWatcher, NameValueCollection properties)
{
+ _configScope.Properties.Add(properties);
return Build(document, dataSource, useConfigFileWatcher, true);
}
@@ -638,7 +656,6 @@
_configScope.ErrorContext.Reset();
#endregion
-
#region Resolve "resultMap" attribute on Result Property + initialize Discriminator property
foreach(DictionaryEntry entry in _configScope.SqlMapper.ResultMaps)
@@ -663,7 +680,6 @@
_configScope.ErrorContext.Reset();
#endregion
-
}
Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Scope/ConfigurationScope.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Scope/ConfigurationScope.cs?rev=178868&r1=178867&r2=178868&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Scope/ConfigurationScope.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Scope/ConfigurationScope.cs Sat May 28 05:30:01 2005
@@ -89,14 +89,8 @@
/// </summary>
public bool ValidateSqlMap
{
- set
- {
- _validateSqlMap = value;
- }
- get
- {
- return _validateSqlMap;
- }
+ set { _validateSqlMap = value; }
+ get { return _validateSqlMap; }
}
/// <summary>
@@ -104,14 +98,8 @@
/// </summary>
public bool IsXmlValid
{
- set
- {
- _isXmlValid = value;
- }
- get
- {
- return _isXmlValid;
- }
+ set { _isXmlValid = value; }
+ get { return _isXmlValid; }
}
@@ -120,14 +108,8 @@
/// </summary>
public string SqlMapNamespace
{
- set
- {
- _sqlMapNamespace = value;
- }
- get
- {
- return _sqlMapNamespace;
- }
+ set { _sqlMapNamespace = value; }
+ get { return _sqlMapNamespace; }
}
/// <summary>
@@ -135,14 +117,8 @@
/// </summary>
public SqlMapper SqlMapper
{
- set
- {
- _sqlMapper = value;
- }
- get
- {
- return _sqlMapper;
- }
+ set { _sqlMapper = value; }
+ get { return _sqlMapper; }
}
/// <summary>
@@ -150,10 +126,7 @@
/// </summary>
internal TypeHandlerFactory TypeHandlerFactory
{
- get
- {
- return _sqlMapper.TypeHandlerFactory;
- }
+ get { return _sqlMapper.TypeHandlerFactory; }
}
/// <summary>
@@ -161,14 +134,8 @@
/// </summary>
public bool IsCallFromDao
{
- set
- {
- _isCallFromDao = value;
- }
- get
- {
- return _isCallFromDao;
- }
+ set { _isCallFromDao = value; }
+ get { return _isCallFromDao; }
}
/// <summary>
@@ -176,14 +143,8 @@
/// </summary>
public bool IsCacheModelsEnabled
{
- set
- {
- _isCacheModelsEnabled = value;
- }
- get
- {
- return _isCacheModelsEnabled;
- }
+ set { _isCacheModelsEnabled = value; }
+ get { return _isCacheModelsEnabled; }
}
@@ -192,14 +153,8 @@
/// </summary>
public DataSource DataSource
{
- set
- {
- _dataSource = value;
- }
- get
- {
- return _dataSource;
- }
+ set { _dataSource = value; }
+ get { return _dataSource; }
}
/// <summary>
@@ -207,14 +162,8 @@
/// </summary>
public XmlNode NodeContext
{
- set
- {
- _nodeContext = value;
- }
- get
- {
- return _nodeContext;
- }
+ set { _nodeContext = value; }
+ get { return _nodeContext; }
}
/// <summary>
@@ -222,14 +171,8 @@
/// </summary>
public XmlDocument SqlMapConfigDocument
{
- set
- {
- _sqlMapConfigDocument = value;
- }
- get
- {
- return _sqlMapConfigDocument;
- }
+ set { _sqlMapConfigDocument = value; }
+ get { return _sqlMapConfigDocument; }
}
/// <summary>
@@ -237,14 +180,8 @@
/// </summary>
public XmlDocument SqlMapDocument
{
- set
- {
- _sqlMapDocument = value;
- }
- get
- {
- return _sqlMapDocument;
- }
+ set { _sqlMapDocument = value; }
+ get { return _sqlMapDocument; }
}
/// <summary>
@@ -252,14 +189,8 @@
/// </summary>
public bool UseConfigFileWatcher
{
- set
- {
- _useConfigFileWatcher = value;
- }
- get
- {
- return _useConfigFileWatcher;
- }
+ set { _useConfigFileWatcher = value; }
+ get { return _useConfigFileWatcher; }
}
/// <summary>
@@ -267,14 +198,8 @@
/// </summary>
public bool UseStatementNamespaces
{
- set
- {
- _useStatementNamespaces = value;
- }
- get
- {
- return _useStatementNamespaces;
- }
+ set { _useStatementNamespaces = value; }
+ get { return _useStatementNamespaces; }
}
/// <summary>
@@ -282,10 +207,7 @@
/// </summary>
public ErrorContext ErrorContext
{
- get
- {
- return _errorContext;
- }
+ get { return _errorContext; }
}
/// <summary>
@@ -293,10 +215,7 @@
/// </summary>
public HybridDictionary Providers
{
- get
- {
- return _providers;
- }
+ get { return _providers; }
}
/// <summary>
@@ -304,10 +223,7 @@
/// </summary>
public NameValueCollection Properties
{
- get
- {
- return _properties;
- }
+ get { return _properties; }
}
/// <summary>
@@ -315,14 +231,8 @@
/// </summary>
public bool UseEmbedStatementParams
{
- get
- {
- return _useEmbedStatementParams;
- }
- set
- {
- _useEmbedStatementParams = value;
- }
+ get { return _useEmbedStatementParams; }
+ set { _useEmbedStatementParams = value; }
}
#endregion
Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapper.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapper.cs?rev=178868&r1=178867&r2=178868&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapper.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapper.cs Sat May 28 05:30:01 2005
@@ -181,7 +181,7 @@
/// </summary>
/// <returns>An SqlMap</returns>
/// <remarks>The file path is relative to the application root.</remarks>
- [Obsolete("This method will be remove in next version, use DomSqlMapBuilder.Configure.", false)]
+ [Obsolete("This method will be remove in future version, use DomSqlMapBuilder.Configure.", false)]
static public SqlMapper Configure()
{
return Configure( Resources.GetConfigAsXmlDocument(DomSqlMapBuilder.DEFAULT_FILE_CONFIG_NAME) );
@@ -192,10 +192,11 @@
/// Configure an SqlMap from via a relative ressource path.
/// </summary>
/// <param name="resource">
- /// A relative ressource path from your Application root.
+ /// A relative ressource path from your Application root
+ /// or an absolue file path file:\\c:\dir\a.config
/// </param>
/// <returns>An SqlMap</returns>
- [Obsolete("This method will be remove in next version, use DomSqlMapBuilder.Configure.", false)]
+ [Obsolete("This method will be remove in future version, use DomSqlMapBuilder.Configure.", false)]
public static SqlMapper Configure(string resource)
{
XmlDocument document = null;
@@ -216,7 +217,7 @@
/// and automatically reconfigure SqlMap.
/// </summary>
/// <returns>An SqlMap</returns>
- [Obsolete("This method will be remove in next version, use DomSqlMapBuilder.Configure.", false)]
+ [Obsolete("This method will be remove in future version, use DomSqlMapBuilder.Configure.", false)]
public static SqlMapper ConfigureAndWatch(ConfigureHandler configureDelegate)
{
return ConfigureAndWatch( DomSqlMapBuilder.DEFAULT_FILE_CONFIG_NAME, configureDelegate ) ;
@@ -228,13 +229,14 @@
/// and automatically reconfigure SqlMap.
/// </summary>
/// <param name="resource">
- /// A relative ressource path from your Application root.
+ /// A relative ressource path from your Application root
+ /// or a absolue file path file:\\c:\dir\a.config
/// </param>
///<param name="configureDelegate">
/// Delegate called when the file has changed, to rebuild the dal.
/// </param>
/// <returns>An SqlMap</returns>
- [Obsolete("This method will be remove in next version, use DomSqlMapBuilder.Configure.", false)]
+ [Obsolete("This method will be remove in future version, use DomSqlMapBuilder.Configure.", false)]
public static SqlMapper ConfigureAndWatch( string resource, ConfigureHandler configureDelegate )
{
XmlDocument document = null;