Author: rgrabowski
Date: Sun Jun 14 02:01:00 2009
New Revision: 784500
URL: http://svn.apache.org/viewvc?rev=784500&view=rev
Log:
Initial support for 'condenseSql' statement attribute to preserves whitespace
of sql text. Setting can be applied at the statement level as well as by a
global setting.
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/ConfigurationSetting.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/DefaultConfigurationEngine.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/DefaultModelBuilder.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Interpreters/Config/ConfigConstants.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/ModelBuilder/BuildStatements.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/BaseStatementDeSerializer.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/DeleteDeSerializer.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/InsertDeSerializer.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/ProcedureDeSerializer.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/SelectDeSerializer.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/SelectKeyDeSerializer.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/StatementDeSerializer.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/UpdateDeSerializer.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/ParameterMapping/InlineParemeterMapBuilder.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Delete.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/IStatement.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Insert.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/PreparedStatement.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Procedure.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Select.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/SelectKey.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Statement.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Update.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Session/DataMapperLocalSessionScope.cs
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/SqlMap.xsd
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/SqlMapConfig.xsd
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/ConfigurationSetting.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/ConfigurationSetting.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/ConfigurationSetting.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/ConfigurationSetting.cs
Sun Jun 14 02:01:00 2009
@@ -51,6 +51,7 @@
private bool useStatementNamespaces = false;
private bool isCacheModelsEnabled = false;
private bool useReflectionOptimizer = true;
+ private bool condenseSql = true;
/// <summary>
/// Gets or sets the dynamic SQL engine.
@@ -178,5 +179,14 @@
get { return useReflectionOptimizer; }
set { useReflectionOptimizer = value; }
}
+
+ /// <summary>
+ ///
+ /// </summary>
+ public bool CondenseSql
+ {
+ get { return condenseSql; }
+ set { condenseSql = value; }
+ }
}
}
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/DefaultConfigurationEngine.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/DefaultConfigurationEngine.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/DefaultConfigurationEngine.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/DefaultConfigurationEngine.cs
Sun Jun 14 02:01:00 2009
@@ -89,19 +89,12 @@
this.configurationSetting = configurationSetting;
- IConfiguration config = new MutableConfiguration(
- ConfigConstants.ATTRIBUTE_VALIDATE_SQLMAP,
- ConfigConstants.ATTRIBUTE_VALIDATE_SQLMAP,
- configurationSetting.ValidateMapperConfigFile.ToString()
- );
- configurationStore.AddSettingConfiguration(config);
-
if (configurationSetting.Properties.Count > 0)
{
IEnumerator<KeyValuePair<string, string>> properties =
configurationSetting.Properties.GetEnumerator();
while (properties.MoveNext())
{
- config = new MutableConfiguration(
+ IConfiguration config = new MutableConfiguration(
ConfigConstants.ELEMENT_PROPERTY,
properties.Current.Key,
properties.Current.Value);
@@ -152,6 +145,17 @@
modules.Add(module);
}
+ private bool tryGetSettingBoolean(string attributeKey, bool
defaultValue)
+ {
+ var setting = configurationStore.Settings[attributeKey];
+ if (setting != null)
+ {
+ return (bool)setting.GetValue(typeof(bool), defaultValue);
+ }
+
+ return defaultValue;
+ }
+
/// <summary>
/// Builds the mapper factory.
@@ -163,6 +167,13 @@
if (interpreter!=null)
{
interpreter.ProcessResource(configurationStore);
+
+ // ensure that the default configuration settings get updated
after the interpreter runs
+ configurationSetting.CondenseSql =
tryGetSettingBoolean(ConfigConstants.ATTRIBUTE_CONDENSESQL,
configurationSetting.CondenseSql);
+ configurationSetting.UseReflectionOptimizer =
tryGetSettingBoolean(ConfigConstants.ATTRIBUTE_USE_REFLECTION_OPTIMIZER,
configurationSetting.UseReflectionOptimizer);
+ configurationSetting.IsCacheModelsEnabled =
tryGetSettingBoolean(ConfigConstants.ATTRIBUTE_CACHE_MODELS_ENABLED,
configurationSetting.IsCacheModelsEnabled);
+ configurationSetting.UseStatementNamespaces =
tryGetSettingBoolean(ConfigConstants.ATTRIBUTE_USE_STATEMENT_NAMESPACES,
configurationSetting.UseStatementNamespaces);
+ configurationSetting.ValidateMapperConfigFile =
tryGetSettingBoolean(ConfigConstants.ATTRIBUTE_VALIDATE_SQLMAP,
configurationSetting.ValidateMapperConfigFile);
}
// Registers code configuration element
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/DefaultModelBuilder.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/DefaultModelBuilder.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/DefaultModelBuilder.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/DefaultModelBuilder.cs
Sun Jun 14 02:01:00 2009
@@ -72,6 +72,7 @@
private bool useStatementNamespaces = false;
private bool isCacheModelsEnabled = false;
private bool useReflectionOptimizer = true;
+ private bool condenseSql = true;
private int commandTimeOut = -1;
private readonly WaitResultPropertyResolution
waitResultPropertyResolution = null;
@@ -122,6 +123,7 @@
isCacheModelsEnabled =
configurationSetting.IsCacheModelsEnabled;
useStatementNamespaces =
configurationSetting.UseStatementNamespaces;
useReflectionOptimizer =
configurationSetting.UseReflectionOptimizer;
+ condenseSql = configurationSetting.CondenseSql;
}
// Xml setting override code setting
@@ -212,7 +214,7 @@
discriminators[i].Initialize(modelStore);
}
BuildParameterMaps(store);
- BuildMappedStatements(store);
+ BuildMappedStatements(store, configurationSetting);
for (int i = 0; i < store.CacheModels.Length; i++)
{
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Interpreters/Config/ConfigConstants.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Interpreters/Config/ConfigConstants.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Interpreters/Config/ConfigConstants.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Interpreters/Config/ConfigConstants.cs
Sun Jun 14 02:01:00 2009
@@ -52,6 +52,11 @@
#region Token attribute
/// <summary>
+ /// Token for attribute condenseSql
+ /// </summary>
+ public const string ATTRIBUTE_CONDENSESQL = "condenseSql";
+
+ /// <summary>
/// Token for attribute sqlSource
/// </summary>
public const string ATTRIBUTE_SQLSOURCE = "sqlSource";
@@ -273,7 +278,11 @@
#region Token element
/// <summary>
- /// Token to odentify the empty parameter map.
+ /// Token to preserve whitespace in statements.
+ /// </summary>
+ public const string ELEMENT_CONDENSESQL = "condenseSql";
+ /// <summary>
+ /// Token to identify the empty parameter map.
/// </summary>
public const string EMPTY_PARAMETER_MAP = "iBATIS.Empty.ParameterMap";
/// <summary>
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/ModelBuilder/BuildStatements.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/ModelBuilder/BuildStatements.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/ModelBuilder/BuildStatements.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/ModelBuilder/BuildStatements.cs
Sun Jun 14 02:01:00 2009
@@ -23,6 +23,7 @@
********************************************************************************/
#endregion
+using System;
using System.Text;
using Apache.Ibatis.Common.Configuration;
using Apache.Ibatis.Common.Contracts;
@@ -52,7 +53,8 @@
/// Builds the mapped statements.
/// </summary>
/// <param name="store">The store.</param>
- private void BuildMappedStatements(IConfigurationStore store)
+ /// <param name="configurationSetting"></param>
+ private void BuildMappedStatements(IConfigurationStore store,
ConfigurationSetting configurationSetting)
{
for (int i = 0; i < store.Statements.Length; i++)
{
@@ -62,22 +64,22 @@
switch (statementConfig.Type)
{
case ConfigConstants.ELEMENT_STATEMENT:
- mappedStatement = BuildStatement(statementConfig);
+ mappedStatement = BuildStatement(statementConfig,
configurationSetting);
break;
case ConfigConstants.ELEMENT_SELECT:
- mappedStatement = BuildSelect(statementConfig);
+ mappedStatement = BuildSelect(statementConfig,
configurationSetting);
break;
case ConfigConstants.ELEMENT_INSERT:
- mappedStatement = BuildInsert(statementConfig);
+ mappedStatement = BuildInsert(statementConfig,
configurationSetting);
break;
case ConfigConstants.ELEMENT_UPDATE:
- mappedStatement = BuildUpdate(statementConfig);
+ mappedStatement = BuildUpdate(statementConfig,
configurationSetting);
break;
case ConfigConstants.ELEMENT_DELETE:
- mappedStatement = BuildDelete(statementConfig);
+ mappedStatement = BuildDelete(statementConfig,
configurationSetting);
break;
case ConfigConstants.ELEMENT_PROCEDURE:
- mappedStatement = BuildProcedure(statementConfig);
+ mappedStatement = BuildProcedure(statementConfig,
configurationSetting);
break;
case ConfigConstants.ELEMENT_SQL:
break;
@@ -112,10 +114,11 @@
/// Builds a <see cref="Statement"/> for a statement configuration.
/// </summary>
/// <param name="statementConfig">The statement config.</param>
- private IMappedStatement BuildStatement(IConfiguration statementConfig)
+ /// <param name="configurationSetting"></param>
+ private IMappedStatement BuildStatement(IConfiguration
statementConfig, ConfigurationSetting configurationSetting)
{
BaseStatementDeSerializer statementDeSerializer = new
StatementDeSerializer();
- IStatement statement =
statementDeSerializer.Deserialize(modelStore, statementConfig);
+ IStatement statement =
statementDeSerializer.Deserialize(modelStore, statementConfig,
configurationSetting);
ProcessSqlStatement(statementConfig, statement);
MappedStatement mappedStatement = new MappedStatement(modelStore,
statement);
@@ -126,10 +129,11 @@
/// Builds an <see cref="Insert"/> for a insert configuration.
/// </summary>
/// <param name="statementConfig">The statement config.</param>
- private IMappedStatement BuildInsert(IConfiguration statementConfig)
+ /// <param name="configurationSetting"></param>
+ private IMappedStatement BuildInsert(IConfiguration statementConfig,
ConfigurationSetting configurationSetting)
{
BaseStatementDeSerializer insertDeSerializer = new
InsertDeSerializer();
- IStatement statement = insertDeSerializer.Deserialize(modelStore,
statementConfig);
+ IStatement statement = insertDeSerializer.Deserialize(modelStore,
statementConfig, configurationSetting);
ProcessSqlStatement(statementConfig, statement);
MappedStatement mappedStatement = new
InsertMappedStatement(modelStore, statement);
Insert insert = (Insert)statement;
@@ -150,10 +154,11 @@
/// Builds an <see cref="Statement"/> for a statement configuration.
/// </summary>
/// <param name="statementConfig">The statement config.</param>
- private IMappedStatement BuildUpdate(IConfiguration statementConfig)
+ /// <param name="configurationSetting"></param>
+ private IMappedStatement BuildUpdate(IConfiguration statementConfig,
ConfigurationSetting configurationSetting)
{
BaseStatementDeSerializer updateDeSerializer = new
UpdateDeSerializer();
- IStatement statement = updateDeSerializer.Deserialize(modelStore,
statementConfig);
+ IStatement statement = updateDeSerializer.Deserialize(modelStore,
statementConfig, configurationSetting);
ProcessSqlStatement(statementConfig, statement);
MappedStatement mappedStatement = new
UpdateMappedStatement(modelStore, statement);
@@ -165,10 +170,11 @@
/// Builds an <see cref="Delete"/> for a delete configuration.
/// </summary>
/// <param name="statementConfig">The statement config.</param>
- private IMappedStatement BuildDelete(IConfiguration statementConfig)
+ /// <param name="configurationSetting"></param>
+ private IMappedStatement BuildDelete(IConfiguration statementConfig,
ConfigurationSetting configurationSetting)
{
BaseStatementDeSerializer deleteDeSerializer = new
DeleteDeSerializer();
- IStatement statement = deleteDeSerializer.Deserialize(modelStore,
statementConfig);
+ IStatement statement = deleteDeSerializer.Deserialize(modelStore,
statementConfig, configurationSetting);
ProcessSqlStatement(statementConfig, statement);
MappedStatement mappedStatement = new
DeleteMappedStatement(modelStore, statement);
@@ -180,10 +186,11 @@
/// Builds an <see cref="Select"/> for a select configuration.
/// </summary>
/// <param name="statementConfig">The statement config.</param>
- private IMappedStatement BuildSelect(IConfiguration statementConfig)
+ /// <param name="configurationSetting"></param>
+ private IMappedStatement BuildSelect(IConfiguration statementConfig,
ConfigurationSetting configurationSetting)
{
BaseStatementDeSerializer selectDeSerializer = new
SelectDeSerializer();
- IStatement statement = selectDeSerializer.Deserialize(modelStore,
statementConfig);
+ IStatement statement = selectDeSerializer.Deserialize(modelStore,
statementConfig, configurationSetting);
ProcessSqlStatement(statementConfig, statement);
MappedStatement mappedStatement = new
SelectMappedStatement(modelStore, statement);
@@ -195,10 +202,11 @@
/// Builds an <see cref="Procedure"/> for a procedure configuration.
/// </summary>
/// <param name="statementConfig">The statement config.</param>
- private IMappedStatement BuildProcedure(IConfiguration statementConfig)
+ /// <param name="configurationSetting"></param>
+ private IMappedStatement BuildProcedure(IConfiguration
statementConfig, ConfigurationSetting configurationSetting)
{
BaseStatementDeSerializer procedureDeSerializer = new
ProcedureDeSerializer();
- IStatement statement =
procedureDeSerializer.Deserialize(modelStore, statementConfig);
+ IStatement statement =
procedureDeSerializer.Deserialize(modelStore, statementConfig,
configurationSetting);
ProcessSqlStatement(statementConfig, statement);
MappedStatement mappedStatement = new MappedStatement(modelStore,
statement);
@@ -219,7 +227,7 @@
if (statement.SqlSource!=null)
{
- #region SqlSource
+ #region sqlSource - external processor
string commandText = string.Empty;
if (statementConfiguration.Children.Count > 0)
@@ -227,6 +235,7 @@
IConfiguration child = statementConfiguration.Children[0];
if (child.Type == ConfigConstants.ELEMENT_TEXT ||
child.Type == ConfigConstants.ELEMENT_CDATA)
{
+ // pass the unformated sql to the external processor
commandText = child.Value;
}
}
@@ -237,7 +246,7 @@
}
else
{
- #region other case
+ #region default - internal processor
bool isDynamic = false;
DynamicSql dynamic = new DynamicSql(
@@ -291,6 +300,8 @@
modelStore.DataExchangeFactory,
modelStore.DBHelperParameterCache,
statement);
+
+ // this does not open a connection to the database
ISession session =
modelStore.SessionFactory.OpenSession();
((StaticSql)statement.Sql).BuildPreparedStatement(session, newSqlCommandText);
@@ -331,20 +342,29 @@
IConfiguration child = children[i];
if (child.Type == ConfigConstants.ELEMENT_TEXT || child.Type
== ConfigConstants.ELEMENT_CDATA)
{
+ string childValueString = child.Value;
+ if (statement.CondenseSql)
+ {
+ childValueString = childValueString
+ .Replace('\n', ' ')
+ .Replace('\r', ' ')
+ .Replace('\t', ' ')
+ .Trim();
+ }
+
SqlText sqlText = null;
if (postParseRequired)
{
sqlText = new SqlText();
- sqlText.Text = child.Value;
+ sqlText.Text = childValueString;
}
else
{
-
- sqlText =
InlineParameterMapParser.ParseInlineParameterMap(modelStore.DataExchangeFactory,
statementConfig.Id, null, child.Value);
+ sqlText =
InlineParameterMapParser.ParseInlineParameterMap(modelStore.DataExchangeFactory,
statementConfig.Id, null, childValueString);
}
dynamic.AddChild(sqlText);
- sqlBuffer.Append(" "+child.Value);
+ sqlBuffer.Append(" " + childValueString);
}
else if (child.Type == ConfigConstants.ELEMENT_SELECTKEY ||
child.Type == ConfigConstants.ELEMENT_INCLUDE)
{ }
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/BaseStatementDeSerializer.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/BaseStatementDeSerializer.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/BaseStatementDeSerializer.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/BaseStatementDeSerializer.cs
Sun Jun 14 02:01:00 2009
@@ -58,6 +58,7 @@
protected bool remapResults = false;
protected string nameSpace = string.Empty;
protected string sqlSourceClassName = string.Empty;
+ protected bool condenseSql = true;
protected ResultMapCollection resultsMap = new ResultMapCollection();
protected Type resultClass = null;
@@ -71,12 +72,14 @@
/// <summary>
/// Deserializes the specified configuration in a Statement object.
/// </summary>
- /// <param name="modelStore">The model store.</param>
+ /// <param name="modelStore"></param>
/// <param name="config">The config.</param>
+ /// <param name="configurationSetting">Default settings.</param>
/// <returns></returns>
- protected void BaseDeserialize(IModelStore modelStore, IConfiguration
config)
+ protected void BaseDeserialize(IModelStore modelStore, IConfiguration
config, ConfigurationSetting configurationSetting)
{
- id = config.Id;
+ nameSpace =
ConfigurationUtils.GetStringAttribute(config.Attributes,
ConfigConstants.ATTRIBUTE_NAMESPACE);
+ id = configurationSetting.UseStatementNamespaces ?
ApplyNamespace(nameSpace, config.Id) : config.Id;
cacheModelName =
ConfigurationUtils.GetStringAttribute(config.Attributes,
ConfigConstants.ATTRIBUTE_CACHEMODEL);
extendsName =
ConfigurationUtils.GetStringAttribute(config.Attributes,
ConfigConstants.ATTRIBUTE_EXTENDS);
listClassName =
ConfigurationUtils.GetStringAttribute(config.Attributes,
ConfigConstants.ATTRIBUTE_LISTCLASS);
@@ -85,8 +88,8 @@
resultClassName =
ConfigurationUtils.GetStringAttribute(config.Attributes,
ConfigConstants.ATTRIBUTE_RESULTCLASS);
resultMapName =
ConfigurationUtils.GetStringAttribute(config.Attributes,
ConfigConstants.ATTRIBUTE_RESULTMAP);
remapResults =
ConfigurationUtils.GetBooleanAttribute(config.Attributes,
ConfigConstants.ATTRIBUTE_REMAPRESULTS, false);
- nameSpace =
ConfigurationUtils.GetStringAttribute(config.Attributes,
ConfigConstants.ATTRIBUTE_NAMESPACE);
sqlSourceClassName =
ConfigurationUtils.GetStringAttribute(config.Attributes,
ConfigConstants.ATTRIBUTE_SQLSOURCE);
+ condenseSql =
ConfigurationUtils.GetBooleanAttribute(config.Attributes,
ConfigConstants.ATTRIBUTE_CONDENSESQL, configurationSetting.CondenseSql);
// Gets the results Map
if (resultMapName.Length > 0)
@@ -156,7 +159,7 @@
/// <param name="modelStore">The model store.</param>
/// <param name="config">The config.</param>
/// <returns></returns>
- public abstract IStatement Deserialize(IModelStore modelStore,
IConfiguration config);
+ public abstract IStatement Deserialize(IModelStore modelStore,
IConfiguration config, ConfigurationSetting configurationSetting);
/// <summary>
/// Register under Statement Name or Fully Qualified Statement Name
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/DeleteDeSerializer.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/DeleteDeSerializer.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/DeleteDeSerializer.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/DeleteDeSerializer.cs
Sun Jun 14 02:01:00 2009
@@ -47,10 +47,11 @@
/// </summary>
/// <param name="modelStore">The model store.</param>
/// <param name="config">The config.</param>
+ /// <param name="configurationSetting"></param>
/// <returns></returns>
- public override IStatement Deserialize(IModelStore modelStore,
IConfiguration config)
+ public override IStatement Deserialize(IModelStore modelStore,
IConfiguration config, ConfigurationSetting configurationSetting)
{
- BaseDeserialize(modelStore, config);
+ BaseDeserialize(modelStore, config, configurationSetting);
return new Delete(
id,
@@ -63,7 +64,8 @@
cacheModel,
remapResults,
extendsName,
- sqlSource);
+ sqlSource,
+ condenseSql);
}
}
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/InsertDeSerializer.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/InsertDeSerializer.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/InsertDeSerializer.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/InsertDeSerializer.cs
Sun Jun 14 02:01:00 2009
@@ -50,12 +50,13 @@
/// </summary>
/// <param name="modelStore">The model store.</param>
/// <param name="config">The config.</param>
+ /// <param name="configurationSetting"></param>
/// <returns></returns>
- public override IStatement Deserialize(IModelStore modelStore,
IConfiguration config)
+ public override IStatement Deserialize(IModelStore modelStore,
IConfiguration config, ConfigurationSetting configurationSetting)
{
- BaseDeserialize(modelStore, config);
+ BaseDeserialize(modelStore, config, configurationSetting);
- SelectKey selectKey = BuildSelectKey(modelStore, config);
+ SelectKey selectKey = BuildSelectKey(modelStore, config,
configurationSetting);
return new Insert(
id,
@@ -69,11 +70,12 @@
remapResults,
extendsName,
selectKey,
- sqlSource
+ sqlSource,
+ condenseSql
);
}
- private SelectKey BuildSelectKey(IModelStore modelStore,
IConfiguration config)
+ private SelectKey BuildSelectKey(IModelStore modelStore,
IConfiguration config, ConfigurationSetting configurationSetting)
{
SelectKey selectKey = null;
@@ -84,7 +86,7 @@
IConfiguration selectKeyConfig = selectKeys[0];
BaseStatementDeSerializer selectKeyDeSerializer = new
SelectKeyDeSerializer();
- selectKey =
(SelectKey)selectKeyDeSerializer.Deserialize(modelStore, selectKeyConfig);
+ selectKey =
(SelectKey)selectKeyDeSerializer.Deserialize(modelStore, selectKeyConfig,
configurationSetting);
}
return selectKey;
}
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/ProcedureDeSerializer.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/ProcedureDeSerializer.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/ProcedureDeSerializer.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/ProcedureDeSerializer.cs
Sun Jun 14 02:01:00 2009
@@ -45,10 +45,11 @@
/// </summary>
/// <param name="modelStore">The model store.</param>
/// <param name="config">The config.</param>
+ /// <param name="configurationSetting"></param>
/// <returns></returns>
- public override IStatement Deserialize(IModelStore modelStore,
IConfiguration config)
+ public override IStatement Deserialize(IModelStore modelStore,
IConfiguration config, ConfigurationSetting configurationSetting)
{
- BaseDeserialize(modelStore, config);
+ BaseDeserialize(modelStore, config, configurationSetting);
if (parameterClass!=null)
{
@@ -61,7 +62,6 @@
}
}
-
return new Procedure(
id,
parameterClass,
@@ -73,7 +73,8 @@
cacheModel,
remapResults,
string.Empty,
- sqlSource);
+ sqlSource,
+ condenseSql);
}
}
}
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/SelectDeSerializer.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/SelectDeSerializer.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/SelectDeSerializer.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/SelectDeSerializer.cs
Sun Jun 14 02:01:00 2009
@@ -47,10 +47,11 @@
/// </summary>
/// <param name="modelStore">The model store.</param>
/// <param name="config">The config.</param>
+ /// <param name="configurationSetting"></param>
/// <returns></returns>
- public override IStatement Deserialize(IModelStore modelStore,
IConfiguration config)
+ public override IStatement Deserialize(IModelStore modelStore,
IConfiguration config, ConfigurationSetting configurationSetting)
{
- BaseDeserialize(modelStore, config);
+ BaseDeserialize(modelStore, config, configurationSetting);
return new Select(
id,
@@ -63,7 +64,8 @@
cacheModel,
remapResults,
extendsName,
- sqlSource);
+ sqlSource,
+ condenseSql);
}
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/SelectKeyDeSerializer.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/SelectKeyDeSerializer.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/SelectKeyDeSerializer.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/SelectKeyDeSerializer.cs
Sun Jun 14 02:01:00 2009
@@ -46,10 +46,11 @@
/// </summary>
/// <param name="modelStore">The model store.</param>
/// <param name="config">The config.</param>
+ /// <param name="configurationSetting"></param>
/// <returns></returns>
- public override IStatement Deserialize(IModelStore modelStore,
IConfiguration config)
+ public override IStatement Deserialize(IModelStore modelStore,
IConfiguration config, ConfigurationSetting configurationSetting)
{
- BaseDeserialize(modelStore, config);
+ BaseDeserialize(modelStore, config, configurationSetting);
string propertyName =
ConfigurationUtils.GetMandatoryStringAttribute(config,
ConfigConstants.ATTRIBUTE_PROPERTY);
SelectKeyType selectKeyType =
ReadSelectKeyType(ConfigurationUtils.GetMandatoryStringAttribute(config,
ConfigConstants.ATTRIBUTE_TYPE));
@@ -60,10 +61,8 @@
resultClass,
resultsMap,
selectKeyType,
- sqlSource );
-
-
-
+ sqlSource,
+ condenseSql);
}
private SelectKeyType ReadSelectKeyType(string s)
@@ -72,6 +71,7 @@
{
case @"pre": return selectkeyty...@pre;
case @"post": return selectkeyty...@post;
+ case @"inline": return selectkeyty...@inline;
default: throw new ConfigurationException("Unknown selectKey
type : '" + s + "'");
}
}
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/StatementDeSerializer.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/StatementDeSerializer.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/StatementDeSerializer.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/StatementDeSerializer.cs
Sun Jun 14 02:01:00 2009
@@ -54,10 +54,11 @@
/// </summary>
/// <param name="modelStore">The model store.</param>
/// <param name="config">The config.</param>
+ /// <param name="configurationSetting"></param>
/// <returns></returns>
- public override IStatement Deserialize(IModelStore modelStore,
IConfiguration config)
+ public override IStatement Deserialize(IModelStore modelStore,
IConfiguration config, ConfigurationSetting configurationSetting)
{
- BaseDeserialize(modelStore, config);
+ BaseDeserialize(modelStore, config, configurationSetting);
return new Statement(
id,
@@ -70,7 +71,8 @@
cacheModel,
remapResults,
extendsName,
- sqlSource);
+ sqlSource,
+ condenseSql);
}
}
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/UpdateDeSerializer.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/UpdateDeSerializer.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/UpdateDeSerializer.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/Serializers/UpdateDeSerializer.cs
Sun Jun 14 02:01:00 2009
@@ -48,10 +48,11 @@
/// </summary>
/// <param name="modelStore">The model store.</param>
/// <param name="config">The config.</param>
+ /// <param name="configurationSetting"></param>
/// <returns></returns>
- public override IStatement Deserialize(IModelStore modelStore,
IConfiguration config)
+ public override IStatement Deserialize(IModelStore modelStore,
IConfiguration config, ConfigurationSetting configurationSetting)
{
- BaseDeserialize(modelStore, config);
+ BaseDeserialize(modelStore, config, configurationSetting);
return new Update(
id,
@@ -59,7 +60,8 @@
parameterMap,
remapResults,
extendsName,
- sqlSource);
+ sqlSource,
+ condenseSql);
}
}
}
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/ParameterMapping/InlineParemeterMapBuilder.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/ParameterMapping/InlineParemeterMapBuilder.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/ParameterMapping/InlineParemeterMapBuilder.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/ParameterMapping/InlineParemeterMapBuilder.cs
Sun Jun 14 02:01:00 2009
@@ -116,7 +116,7 @@
{
newSqlCommandText = newSqlCommandText.Replace(MARK_TOKEN,
string.Empty).Replace(COMMA_TOKEN, string.Empty);
}
- newSqlCommandText = newSqlCommandText.Trim();
+ // newSqlCommandText = newSqlCommandText.Trim();
return map;
}
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Delete.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Delete.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Delete.cs
(original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Delete.cs
Sun Jun 14 02:01:00 2009
@@ -72,9 +72,10 @@
CacheModel cacheModel,
bool remapResults,
string extends,
- ISqlSource sqlSource
+ ISqlSource sqlSource,
+ bool condenseSql
)
- : base(id, parameterClass, parameterMap, resultClass, resultMaps,
listClass, listClassFactory, cacheModel, remapResults, extends, sqlSource)
+ : base(id, parameterClass, parameterMap, resultClass, resultMaps,
listClass, listClassFactory, cacheModel, remapResults, extends, sqlSource,
condenseSql)
{}
}
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/IStatement.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/IStatement.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/IStatement.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/IStatement.cs
Sun Jun 14 02:01:00 2009
@@ -109,13 +109,17 @@
/// <value>The list class.</value>
Type ListClass { get; }
-
/// <summary>
/// Gets or sets the SQL source.
/// </summary>
/// <value>The SQL source.</value>
ISqlSource SqlSource { get; set; }
+ /// <summary>
+ ///
+ /// </summary>
+ bool CondenseSql { get; }
+
#endregion
#region Methods
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Insert.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Insert.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Insert.cs
(original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Insert.cs
Sun Jun 14 02:01:00 2009
@@ -93,13 +93,12 @@
bool remapResults,
string extends,
SelectKey selectKey,
- ISqlSource sqlSource
+ ISqlSource sqlSource,
+ bool condenseSql
)
- : base(id, parameterClass, parameterMap, resultClass, resultMaps,
listClass, listClassFactory, cacheModel, remapResults, extends, sqlSource)
+ : base(id, parameterClass, parameterMap, resultClass, resultMaps,
listClass, listClassFactory, cacheModel, remapResults, extends, sqlSource,
condenseSql)
{
this.selectKey = selectKey;
}
-
-
}
}
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/PreparedStatement.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/PreparedStatement.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/PreparedStatement.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/PreparedStatement.cs
Sun Jun 14 02:01:00 2009
@@ -34,14 +34,18 @@
namespace Apache.Ibatis.DataMapper.Model.Statements
{
/// <summary>
- /// Construct the list of IDataParameters for the statement
- /// and prepare the sql
- /// </summary>
+ /// Construct the list of IDataParameters for the statement and prepare
the sql.
+ /// </summary>
+ /// <remarks>
+ /// This class is used as a template for filling the parameters
+ /// on a real IDbCommand. The template is constructured once and its
values are copied
+ /// to the current command's parameter as appropriate.
+ /// </remarks>
public class PreparedStatement
{
#region Fields
- private string _preparedSsql = string.Empty;
+ private string _preparedSql = string.Empty;
private StringCollection _dbParametersName = new
StringCollection ();
private IDbDataParameter[] _dbParameters = null;
@@ -72,8 +76,8 @@
/// </summary>
public string PreparedSql
{
- get { return _preparedSsql; }
- set {_preparedSsql = value;}
+ get { return _preparedSql; }
+ set {_preparedSql = value;}
}
#endregion
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Procedure.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Procedure.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Procedure.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Procedure.cs
Sun Jun 14 02:01:00 2009
@@ -91,9 +91,10 @@
CacheModel cacheModel,
bool remapResults,
string extends,
- ISqlSource sqlSource
+ ISqlSource sqlSource,
+ bool condenseSql
)
- : base(id, parameterClass, parameterMap, resultClass, resultMaps,
listClass, listClassFactory, cacheModel, remapResults, extends, sqlSource)
+ : base(id, parameterClass, parameterMap, resultClass, resultMaps,
listClass, listClassFactory, cacheModel, remapResults, extends, sqlSource,
condenseSql)
{}
}
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Select.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Select.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Select.cs
(original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Select.cs
Sun Jun 14 02:01:00 2009
@@ -66,9 +66,10 @@
CacheModel cacheModel,
bool remapResults,
string extends,
- ISqlSource sqlSource
+ ISqlSource sqlSource,
+ bool condenseSql
)
- : base(id, parameterClass, parameterMap, resultClass, resultMaps,
listClass, listClassFactory, cacheModel, remapResults, extends, sqlSource)
+ : base(id, parameterClass, parameterMap, resultClass, resultMaps,
listClass, listClassFactory, cacheModel, remapResults, extends, sqlSource,
condenseSql)
{}
}
}
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/SelectKey.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/SelectKey.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/SelectKey.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/SelectKey.cs
Sun Jun 14 02:01:00 2009
@@ -97,9 +97,10 @@
Type type,
ResultMapCollection resultMaps,
SelectKeyType selectKeyType,
- ISqlSource sqlSource
+ ISqlSource sqlSource,
+ bool condenseSql
)
- : base(id, null, null, type, resultMaps, null, null, null, false,
string.Empty, sqlSource)
+ : base(id, null, null, type, resultMaps, null, null, null, false,
string.Empty, sqlSource, condenseSql)
{
this.propertyName = propertyName;
this.selectKeyType = selectKeyType;
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Statement.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Statement.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Statement.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Statement.cs
Sun Jun 14 02:01:00 2009
@@ -74,14 +74,17 @@
private readonly bool allowRemapping = false;
[NonSerialized]
private readonly string extends = string.Empty;
+ [NonSerialized]
private ISql sql = null;
+ [NonSerialized]
private ISqlSource sqlSource = null;
+ [NonSerialized]
+ private readonly bool condenseSql = true;
#endregion
#region Properties
-
/// <summary>
/// Gets the result class type.
/// </summary>
@@ -196,6 +199,25 @@
{
get { return CommandType.Text; }
}
+
+ /// <summary>
+ /// Gets the SQL source.
+ /// </summary>
+ /// <value>The SQL source.</value>
+ public ISqlSource SqlSource
+ {
+ get { return sqlSource; }
+ set { sqlSource = value;}
+ }
+
+ /// <summary>
+ ///
+ /// </summary>
+ public bool CondenseSql
+ {
+ get { return condenseSql; }
+ }
+
#endregion
/// <summary>
@@ -212,6 +234,7 @@
/// <param name="remapResults">if set to <c>true</c> [remap
results].</param>
/// <param name="extends">The extends.</param>
/// <param name="sqlSource">The SQL source.</param>
+ /// <param name="condenseSql"></param>
public Statement(
string id,
Type parameterClass,
@@ -223,8 +246,8 @@
CacheModel cacheModel,
bool remapResults,
string extends,
- ISqlSource sqlSource
- )
+ ISqlSource sqlSource,
+ bool condenseSql)
{
Contract.Require.That(id, Is.Not.Null &
Is.Not.Empty).When("retrieving argument id");
@@ -239,6 +262,7 @@
allowRemapping = remapResults;
this.extends = extends;
this.sqlSource = sqlSource;
+ this.condenseSql = condenseSql;
}
#region Methods
@@ -261,21 +285,5 @@
return (IList<T>)listClassFactory.CreateInstance(null);
}
#endregion
-
-
- #region IStatement Members
-
-
- /// <summary>
- /// Gets the SQL source.
- /// </summary>
- /// <value>The SQL source.</value>
- public ISqlSource SqlSource
- {
- get { return sqlSource; }
- set { sqlSource = value;}
- }
-
- #endregion
}
}
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Update.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Update.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Update.cs
(original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Statements/Update.cs
Sun Jun 14 02:01:00 2009
@@ -58,9 +58,9 @@
ParameterMap parameterMap,
bool remapResults,
string extends,
- ISqlSource sqlSource
- )
- : base(id, parameterClass, parameterMap, null, new
ResultMapCollection(), null, null, null, remapResults, extends, sqlSource)
+ ISqlSource sqlSource,
+ bool condenseSql)
+ : base(id, parameterClass, parameterMap, null, new
ResultMapCollection(), null, null, null, remapResults, extends, sqlSource,
condenseSql)
{}
}
Modified:
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Session/DataMapperLocalSessionScope.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Session/DataMapperLocalSessionScope.cs?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
---
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Session/DataMapperLocalSessionScope.cs
(original)
+++
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Session/DataMapperLocalSessionScope.cs
Sun Jun 14 02:01:00 2009
@@ -32,7 +32,7 @@
/// <summary>
/// Local SessionScope management
/// </summary>
- internal class DataMapperLocalSessionScope : IDisposable
+ public class DataMapperLocalSessionScope : IDisposable
{
private readonly bool isSessionLocal = false;
private readonly ISession session = null;
Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/SqlMap.xsd
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/SqlMap.xsd?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/SqlMap.xsd (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/SqlMap.xsd Sun Jun 14
02:01:00 2009
@@ -102,6 +102,7 @@
<xs:attribute name="cacheModel" type="xs:string"/>
<xs:attribute name="listClass" type="xs:string"/>
<xs:attribute name="sqlSource" type="xs:string"/>
+ <xs:attribute name="condenseSql" type="xs:boolean"
default="true"/>
</xs:complexType>
</xs:element>
<xs:element name="delete">
@@ -130,7 +131,8 @@
<xs:attribute name="parameterClass" type="xs:string"/>
<xs:attribute name="extends" type="xs:string"/>
<xs:attribute name="sqlSource" type="xs:string"/>
- <xs:attribute name="remapResults">
+ <xs:attribute name="condenseSql" type="xs:boolean" default="true"/>
+ <xs:attribute name="remapResults">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="false"/>
@@ -214,6 +216,7 @@
<xs:attribute name="parameterMap" type="xs:string"/>
<xs:attribute name="resultClass" type="xs:string"/>
<xs:attribute name="sqlSource" type="xs:string"/>
+ <xs:attribute name="condenseSql" type="xs:boolean" default="true"/>
<xs:attribute name="remapResults">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
@@ -722,6 +725,7 @@
<xs:attribute name="listClass" type="xs:string"/>
<xs:attribute name="extends" type="xs:string"/>
<xs:attribute name="sqlSource" type="xs:string"/>
+ <xs:attribute name="condenseSql" type="xs:boolean" default="true"/>
<xs:attribute name="remapResults">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
@@ -747,6 +751,7 @@
</xs:attribute>
<xs:attribute name="resultClass"
type="xs:string" use="required"/>
<xs:attribute name="sqlSource"
type="xs:string"/>
+ <xs:attribute name="condenseSql" type="xs:boolean" default="true"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
@@ -816,6 +821,7 @@
<xs:attribute name="listClass" type="xs:string"/>
<xs:attribute name="cacheModel" type="xs:string"/>
<xs:attribute name="sqlSource" type="xs:string"/>
+ <xs:attribute name="condenseSql" type="xs:boolean" default="true"/>
<xs:attribute name="remapResults">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
@@ -872,6 +878,7 @@
<xs:attribute name="parameterClass" type="xs:string"/>
<xs:attribute name="extends" type="xs:string"/>
<xs:attribute name="sqlSource" type="xs:string"/>
+ <xs:attribute name="condenseSql" type="xs:boolean" default="true"/>
<xs:attribute name="remapResults">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/SqlMapConfig.xsd
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/SqlMapConfig.xsd?rev=784500&r1=784499&r2=784500&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/SqlMapConfig.xsd (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/SqlMapConfig.xsd Sun Jun 14
02:01:00 2009
@@ -86,6 +86,7 @@
<xs:attribute name="useEmbedStatementParams"
type="xs:boolean" default="false"/>
<xs:attribute name="useReflectionOptimizer"
type="xs:boolean" default="true"/>
<xs:attribute name="commandTimeout"
type="xs:positiveInteger"/>
+ <xs:attribute name="condenseSql" type="xs:boolean"
default="true"/>
</xs:complexType>
</xs:element>
<xs:element name="settings">