Author: gbayon
Date: Tue Jun 27 12:00:19 2006
New Revision: 417556
URL: http://svn.apache.org/viewvc?rev=417556&view=rev
Log:
- Updated doc before release
Modified:
ibatis/trunk/cs/docs/dataMapperGuide/src/en/dotnet.xml
ibatis/trunk/cs/docs/dataMapperGuide/src/en/working.xml
Modified: ibatis/trunk/cs/docs/dataMapperGuide/src/en/dotnet.xml
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/docs/dataMapperGuide/src/en/dotnet.xml?rev=417556&r1=417555&r2=417556&view=diff
==============================================================================
--- ibatis/trunk/cs/docs/dataMapperGuide/src/en/dotnet.xml (original)
+++ ibatis/trunk/cs/docs/dataMapperGuide/src/en/dotnet.xml Tue Jun 27 12:00:19
2006
@@ -800,6 +800,15 @@
debugging.</para><programlisting>Example:
validateSqlMap=âfalseâ
Default: false (disabled)</programlisting></entry>
</row>
+
+ <row>
+ <entry><emphasis>useReflectionOptimizer </emphasis></entry>
+
+ <entry><para>This setting globally enables or disables the
+ usage of reflection to access property/filed value of C#
object. The reflection optimizer use will emit types for retrieving,
populating, instantiating parameter and result objects.
+</para><programlisting>Example: useReflectionOptimizer=âtrueâ
+Default: true (enabled)</programlisting></entry>
+ </row>
</tbody>
</tgroup>
</table>
@@ -1267,7 +1276,7 @@
{
public class Mapper
{
- private static volatile SqlMapper _mapper = null;
+ private static volatile ISqlMapper _mapper = null;
protected static void Configure (object obj)
{
@@ -1281,7 +1290,7 @@
_mapper = builder.ConfigureAndWatch(handler);
}
- public static SqlMapper Instance()
+ public static ISqlMapper Instance()
{
if (_mapper == null)
{
@@ -1296,7 +1305,7 @@
return _mapper;
}
- public static SqlMapper Get()
+ public static ISqlMapper Get()
{
return Instance();
}
@@ -1304,11 +1313,11 @@
}</programlisting>
</example></para>
- <para>To obtain the <classname>SqlMapper</classname> instance, just
+ <para>To obtain the <classname>ISqlMapper</classname> instance, just
call</para>
<para><programlisting>[C#]
-SqlMapper mapper = Mapper.Instance();</programlisting></para>
+ISqlMapper mapper = Mapper.Instance();</programlisting></para>
<para>anywhere in your application, and specify one of the
<classname>SqlMapper</classname> methods (see Section 5.3.2) . Here's an
@@ -1350,7 +1359,7 @@
instead:</para>
<para><programlisting>[C#]
-SqlMapper mapper = builder.Configure();</programlisting></para>
+ISqlMapper mapper = builder.Configure();</programlisting></para>
<sect3>
<title>Multiple Databases</title>
@@ -1362,15 +1371,15 @@
<methodname>ConfigureAndWatch</methodname> to</para>
<para><programlisting>[C#]
-SqlMapper mapper = builder.ConfigureAndWatch("anotherSqlMapConfig.config",
handler);</programlisting></para>
+ISqlMapper mapper = builder.ConfigureAndWatch("anotherSqlMapConfig.config",
handler);</programlisting></para>
<para>and substitute the name of your configuration file. Each
database then has their own singleton you can call from your
application:</para>
<para><programlisting>[C#]
-SqlMapper sqlServer = SqlServerMapper.Get();
-SqlMapper access = AccessMapper.Get();</programlisting></para>
+ISqlMapper sqlServer = SqlServerMapper.Get();
+ISqlMapper access = AccessMapper.Get();</programlisting></para>
</sect3>
<sect3>
@@ -1394,7 +1403,7 @@
<example>
<title>Basic SqlMapper Configuration Call</title>
- <programlisting>SqlMapper mapper =
builder.Configure();</programlisting>
+ <programlisting>ISqlMapper mapper =
builder.Configure();</programlisting>
</example>
<para>If you have named your configuration file something other than
@@ -1410,7 +1419,7 @@
<programlisting><emphasis role="comment">/* Configure a SqlMapper
from a file path.
Uses a relative resource path from your application root
or an absolute file path such as "file:\\c:\dir\a.config" */
-</emphasis>SqlMapper mapper = builder.Configure(strPath);</programlisting>
+</emphasis>ISqlMapper mapper = builder.Configure(strPath);</programlisting>
</example>
<tip>
@@ -1435,11 +1444,11 @@
<programlisting><emphasis role="comment">/* Configure a SqlMapper
with FileInfo. */</emphasis>
FileInfo aFileInfo = someSupportClass.GetDynamicFileInfo();
-SqlMapper mapper = builder.Configure(aFileInfo);
+ISqlMapper mapper = builder.Configure(aFileInfo);
<emphasis role="comment">/* Configure a SqlMapper through a Uri. */</emphasis>
Uri aUri = someSupportClass.GetDynamicUri();
-SqlMapper anotherMapper = builder.Configure(aUri);</programlisting>
+ISqlMapper anotherMapper = builder.Configure(aUri);</programlisting>
</example>
<para>If you find that you already have loaded your DataMapper
@@ -1454,11 +1463,11 @@
<programlisting><emphasis role="comment">/* Configure a SqlMapper
with an XmlDocument */</emphasis>
XmlDocument anXmlDoc = someSupportClass.GetDynamicXmlDocument();
-SqlMapper mapper = builder.Configure(anXmlDoc);
+ISqlMapper mapper = builder.Configure(anXmlDoc);
<emphasis role="comment">/* Configure a SqlMapper from a stream. */</emphasis>
Stream aStream = someSupportClass.GetDynamicStream();
-SqlMapper anotherMapper = builder.Configure(aStream);</programlisting>
+ISqlMapper anotherMapper = builder.Configure(aStream);</programlisting>
</example>
<para>The <classname>DomSqlMapBuilder</classname> API provides
@@ -1508,20 +1517,77 @@
and automatically reconfigure the SqlMapper.
This basic ConfigureAndWatch method looks for a file with the
default name of SqlMap.config in the application root directory. */
-</emphasis>public SqlMapper ConfigureAndWatch(ConfigureHandler
configureDelegate)
+</emphasis>public ISqlMapper ConfigureAndWatch(ConfigureHandler
configureDelegate)
<emphasis role="comment">/* Configure and monitor the configuration file for
modifications
and automatically reconfigure the SqlMapper.
Uses a relative path from your application root
or an absolute file path such as "file:\\c:\dir\a.config" */
-</emphasis>public SqlMapper ConfigureAndWatch( string resource,
ConfigureHandler configureDelegate )
+</emphasis>public ISqlMapper ConfigureAndWatch( string resource,
ConfigureHandler configureDelegate )
<emphasis role="comment">/* Configure and monitor the configuration file for
modifications
and automatically reconfigure the SqlMapper.
Uses a FileInfo instance for your config file. */</emphasis>
-public SqlMapper ConfigureAndWatch( FileInfo resource, ConfigureHandler
configureDelegate )</programlisting>
+public ISqlMapper ConfigureAndWatch( FileInfo resource, ConfigureHandler
configureDelegate )</programlisting>
</example>
</sect3>
+
+ <sect3>
+ <title>DomSqlMapBuilder : Advanced settings</title>
+ <para>Before launching the 'Configure' method to build
the ISqlMapper instance, you can set those porperties.</para>
+
+ <para>
+ <table>
+ <title>Advanced settings</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Propertie</entry>
+
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>Properties</entry>
+
+ <entry>Allow to set properties before configuration. Those
properties will be added to the properties list defined in the
properties.config.
+<programlisting>NameValueCollection properties = new NameValueCollection();
+properties.Add("connectionString", "...");
+builder.Properties = properties;
+
+ISqlMapper mapper = builder.Configure("sqlMap.config");</programlisting>
+ </entry>
+ </row>
+ <row>
+ <entry>GetAccessorFactory</entry>
+
+ <entry>Allow to set a custom get accessor factory before
configuration, see IGetAccessorFactory interface which defines the contract for
the factory responsible to build set accessor for a member object in iBATIS.
+ </entry>
+ </row>
+ <row>
+ <entry>SetAccessorFactory</entry>
+
+ <entry>Allow to set a custom set accessor factory before
configuration, see ISetAccessorFactory interface which defines the contract for
the factory responsible to build get accessor for a member object in iBATIS.
+ </entry>
+ </row>
+ <row>
+ <entry>ObjectFactory</entry>
+ <entry>Allow to set a custom object factory before
configuration, see IObjectFactory interface which defines the contract for the
factory responsible for object creation in iBATIS.
+ </entry>
+ </row>
+ <row>
+ <entry>ValidateSqlMapConfig</entry>
+ <entry>Enable whether or not the validation of configuration
document before configuration </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+
+ </sect3>
</sect2>
<sect2>
Modified: ibatis/trunk/cs/docs/dataMapperGuide/src/en/working.xml
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/docs/dataMapperGuide/src/en/working.xml?rev=417556&r1=417555&r2=417556&view=diff
==============================================================================
--- ibatis/trunk/cs/docs/dataMapperGuide/src/en/working.xml (original)
+++ ibatis/trunk/cs/docs/dataMapperGuide/src/en/working.xml Tue Jun 27 12:00:19
2006
@@ -1075,7 +1075,7 @@
<title>property</title>
<para>The <parameter>property</parameter> attribute of
- <parameter> is the name of a property of the parameter object.
+ <parameter> is the name of a field or property of the parameter
object.
It may also be the name of an entry in a
<interfacename>IDictionary</interfacename> object. The name can be
used more than once depending on the number of times it is needed in
@@ -1504,7 +1504,7 @@
<title>property</title>
<para>The <parameter>property</parameter> attribute is the name of a
- property of the result object that will be returned by the Mapped
+ field or a property of the result object that will be returned by the
Mapped
Statement. The name can be used more than once depending on the number
of times it is needed to populate the results.</para>
</sect3>
@@ -1628,7 +1628,82 @@
<para>Use the lazyLoad attribute with the select attribute to indicate
whether or not the select statement's results should be lazy loaded.
This can provide a performance boost by delaying the loading of the
- select statement's results until they are needed/accessed.</para>
+ select statement's results until they are needed/accessed.
+
+ Lazy loading is supported transparently for IList and
IList<T> implementation.
+ Lazy loading is supported on strongly typed collection via
Castle.DynamicProxy component. In this case you must set the listClass
attribute and declare all methods/properties of the typed collection that you
want to proxy as virtual.
+ </para>
+
+ <para><example>
+ <title>Sample of strongly typed collection used with proxy
call</title>
+
+ <programlisting>
+[C#]
+
+[Serializable]
+public class LineItemCollection : CollectionBase
+{
+ public LineItemCollection() {}
+
+ public virtual LineItem this[int index]
+ {
+ get { return (LineItem)List[index]; }
+ set { List[index] = value; }
+ }
+
+ public virtual int Add(LineItem value)
+ {
+ return List.Add(value);
+ }
+
+ public virtual void AddRange(LineItem[] value)
+ {
+ for (int i = 0; i < value.Length; i++)
+ {
+ Add(value[i]);
+ }
+ }
+
+ public virtual void AddRange(LineItemCollection value)
+ {
+ for (int i = 0; i < value.Count; i++)
+ {
+ Add(value[i]);
+ }
+ }
+
+ public virtual bool Contains(LineItem value)
+ {
+ return List.Contains(value);
+ }
+
+ public virtual void CopyTo(LineItem[] array, int index)
+ {
+ List.CopyTo(array, index);
+ }
+
+ public virtual int IndexOf(LineItem value)
+ {
+ return List.IndexOf(value);
+ }
+
+ public virtual void Insert(int index, LineItem value)
+ {
+ List.Insert(index, value);
+ }
+
+ public virtual void Remove(LineItem value)
+ {
+ List.Remove(value);
+ }
+
+ public new virtual int Count
+ {
+ get {return this.List.Count;}
+ }
+}
+</programlisting>
+ </example></para>
</sect3>
<sect3>
@@ -2553,7 +2628,14 @@
<para>Table 3.4 shows the basic Supported Types for Parameter Maps and
Result Maps for .NET. You can extend the framework's support for
- additional types by using a Custom Type Handler.<table>
+ additional types by using a Custom Type Handler.</para>
+
+ <note>
+ <para>Nuallable type from .NET 2.0 are fully supported by
iBATIS.NET.</para>
+ </note>
+
+ <para>
+ <table>
<title>Supported Types for Parameter Maps and Result Maps
(.NET)</title>
@@ -2760,6 +2842,133 @@
<entry>Ulong, ulong</entry>
</row>
+
+ <row>
+ <entry>Nullable<bool></entry>
+
+ <entry>Yes</entry>
+
+ <entry>Yes</entry>
+
+ <entry>bool?</entry>
+ </row>
+ <row>
+ <entry>Nullable<byte></entry>
+
+ <entry>Yes</entry>
+
+ <entry>Yes</entry>
+
+ <entry>byte?</entry>
+ </row>
+ <row>
+ <entry>Nullable<char></entry>
+
+ <entry>Yes</entry>
+
+ <entry>Yes</entry>
+
+ <entry>char?</entry>
+ </row>
+ <row>
+ <entry>Nullable<DateTime></entry>
+
+ <entry>Yes</entry>
+
+ <entry>Yes</entry>
+
+ <entry>DateTime?</entry>
+ </row>
+ <row>
+ <entry>Nullable<decimal></entry>
+
+ <entry>Yes</entry>
+
+ <entry>Yes</entry>
+
+ <entry>decimal?</entry>
+ </row>
+ <row>
+ <entry>Nullable<double></entry>
+
+ <entry>Yes</entry>
+
+ <entry>Yes</entry>
+
+ <entry>double?</entry>
+ </row>
+ <row>
+ <entry>Nullable<Int16></entry>
+
+ <entry>Yes</entry>
+
+ <entry>Yes</entry>
+
+ <entry>Int16?</entry>
+ </row>
+ <row>
+ <entry>Nullable<Int32></entry>
+
+ <entry>Yes</entry>
+
+ <entry>Yes</entry>
+
+ <entry>Int32?</entry>
+ </row>
+ <row>
+ <entry>Nullable<Int64></entry>
+
+ <entry>Yes</entry>
+
+ <entry>Yes</entry>
+
+ <entry>Int64?</entry>
+ </row>
+ <row>
+ <entry>Nullable<SByte></entry>
+
+ <entry>Yes</entry>
+
+ <entry>Yes</entry>
+
+ <entry>SByte?</entry>
+ </row>
+ <row>
+ <entry>Nullable<Single></entry>
+
+ <entry>Yes</entry>
+
+ <entry>Yes</entry>
+
+ <entry>Single?</entry>
+ </row>
+ <row>
+ <entry>Nullable<UInt16></entry>
+
+ <entry>Yes</entry>
+
+ <entry>Yes</entry>
+
+ <entry>UInt16?</entry>
+ </row>
+ <row>
+ <entry>Nullable<UInt32></entry>
+
+ <entry>Yes</entry>
+
+ <entry>Yes</entry>
+
+ <entry>UInt32?</entry>
+ </row>
+ <row>
+ <entry>Nullable<UInt64></entry>
+
+ <entry>Yes</entry>
+
+ <entry>Yes</entry>
+
+ <entry>UInt64?</entry>
+ </row>
</tbody>
</tgroup>
</table></para>
@@ -2773,6 +2982,10 @@
System.Data.OracleClient assemblies. See the .NET Developer Guide section
on configuring the DataMapper to work with your provider's DbTypes.</para>
+ <note>
+ <para>Nuallable type from .NET 2.0 are fully supported by
iBATIS.NET.</para>
+ </note>
+
<para>The .NET Framework data provider type of a Parameter object is
inferred from the .NET Framework type of the Value of the Parameter
object, or from the DbType of the Parameter object. The following table
@@ -2817,7 +3030,7 @@
</row>
<row>
- <entry>Boolean</entry>
+ <entry>Boolean, bool?</entry>
<entry>Yes</entry>
@@ -2831,9 +3044,9 @@
</row>
<row>
- <entry>Byte</entry>
+ <entry>Byte, byte?</entry>
- <entry>-</entry>
+ <entry>Yes</entry>
<entry>TinyInt</entry>
@@ -2845,7 +3058,7 @@
</row>
<row>
- <entry>DateTime</entry>
+ <entry>DateTime, DateTime?</entry>
<entry>Yes</entry>
@@ -2859,7 +3072,7 @@
</row>
<row>
- <entry>char</entry>
+ <entry>char, char?</entry>
<entry>Yes</entry>
@@ -2873,7 +3086,7 @@
</row>
<row>
- <entry>Decimal</entry>
+ <entry>Decimal, decimal?</entry>
<entry>Yes</entry>
@@ -2887,7 +3100,7 @@
</row>
<row>
- <entry>Double</entry>
+ <entry>Double, double?</entry>
<entry>Yes</entry>
@@ -2901,7 +3114,7 @@
</row>
<row>
- <entry>Guid</entry>
+ <entry>Guid, Guid?</entry>
<entry>Yes</entry>
@@ -2915,7 +3128,7 @@
</row>
<row>
- <entry>Int16</entry>
+ <entry>Int16, Int16?</entry>
<entry>Yes</entry>
@@ -2929,7 +3142,7 @@
</row>
<row>
- <entry>Int32</entry>
+ <entry>Int32, Int32?</entry>
<entry>Yes</entry>
@@ -2943,7 +3156,7 @@
</row>
<row>
- <entry>Int64</entry>
+ <entry>Int64, Int64?</entry>
<entry>Yes</entry>
@@ -2957,7 +3170,7 @@
</row>
<row>
- <entry>Single</entry>
+ <entry>Single, Single?</entry>
<entry>Yes</entry>
@@ -2999,7 +3212,7 @@
</row>
<row>
- <entry>UInt16</entry>
+ <entry>UInt16, UInt16?</entry>
<entry>yes</entry>
@@ -3013,7 +3226,7 @@
</row>
<row>
- <entry>UInt32</entry>
+ <entry>UInt32, UInt32?</entry>
<entry>yes</entry>
@@ -3027,7 +3240,7 @@
</row>
<row>
- <entry>UInt64</entry>
+ <entry>UInt64, UInt64?</entry>
<entry>yes</entry>