You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by gi...@wush.net on 2004/11/15 21:11:49 UTC

r356 - in Source1: . External-Bin/Net/1.1 IBatisNet.DataAccess IBatisNet.DataAccess/Configuration IBatisNet.DataAccess/DaoSessionHandlers IBatisNet.DataAccess/Interfaces IBatisNet.Test IBatisNet.Test/Dao/Implementations IBatisNet.Test/Dao/Implementations/

Author: gilles
Date: 2004-11-15 14:11:48 -0600 (Mon, 15 Nov 2004)
New Revision: 356

Added:
� �Source1/External-Bin/Net/1.1/HashCodeProvider.dll
� �Source1/IBatisNet.Test/Dao/Implementations/Ado/UserDao.cs
� �Source1/IBatisNet.Test/Dao/Implementations/NHibernate/
� �Source1/IBatisNet.Test/Dao/Implementations/NHibernate/UserDao.cs
� �Source1/IBatisNet.Test/Dao/Interfaces/IUserDao.cs
� �Source1/IBatisNet.Test/Dao/Interfaces/IuserDao.cs
� �Source1/IBatisNet.Test/Domain/User.cs
� �Source1/IBatisNet.Test/NUnit/DaoTests/NHibernateDaoTest.cs
� �Source1/IBatisNet.Test/Scripts/MSSQL/user-init.sql
� �Source1/IBatisNet.Test/User.hbm.xml
Removed:
� �Source1/IBatisNet.DataAccess/Interfaces/IDaoSession.cs
Modified:
� �Source1/IBatisNet.DataAccess/Configuration/DomDaoManagerBuilder.cs
� �Source1/IBatisNet.DataAccess/DaoSession.cs
� �Source1/IBatisNet.DataAccess/DaoSessionHandlers/DaoSessionHandlerFactory.cs
� �Source1/IBatisNet.DataAccess/DaoSessionHandlers/NHibernateDaoSession.cs
� �Source1/IBatisNet.DataAccess/DaoSessionHandlers/NHibernateDaoSessionHandler.cs
� �Source1/IBatisNet.DataAccess/DaoSessionHandlers/SimpleDaoSession.cs
� �Source1/IBatisNet.DataAccess/DaoSessionHandlers/SimpleDaoSessionHandler.cs
� �Source1/IBatisNet.DataAccess/DaoSessionHandlers/SqlMapDaoSession.cs
� �Source1/IBatisNet.DataAccess/DaoSessionHandlers/SqlMapDaoSessionHandler.cs
� �Source1/IBatisNet.DataAccess/IBatisNet.DataAccess.csproj
� �Source1/IBatisNet.DataAccess/Interfaces/IDaoSessionHandler.cs
� �Source1/IBatisNet.Test/IBatisNet.Test.csproj
� �Source1/IBatisNet.Test/bin/Debug/dao_MSSQL_SqlClient.config
� �Source1/IBatisNet.sln
Log:
- Finished NHibernate support in DataMapper + Added unit test for NHibernate support

Added: Source1/External-Bin/Net/1.1/HashCodeProvider.dll
===================================================================
(Binary files differ)


Property changes on: Source1/External-Bin/Net/1.1/HashCodeProvider.dll
___________________________________________________________________
Name: svn:mime-type
� �+ application/octet-stream

Modified: Source1/IBatisNet.DataAccess/Configuration/DomDaoManagerBuilder.cs
===================================================================
--- Source1/IBatisNet.DataAccess/Configuration/DomDaoManagerBuilder.cs� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.DataAccess/Configuration/DomDaoManagerBuilder.cs� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -100,6 +100,7 @@
�� � � � � � � � � � � � _daoSectionHandlers.Add(DEFAULT_DAOSESSIONHANDLER_NAME, DaoSessionHandlerFactory.GetDaoSessionHandler("ADONET"));
�� � � � � � � � � � � � _daoSectionHandlers.Add("ADONET", DaoSessionHandlerFactory.GetDaoSessionHandler("ADONET"));
�� � � � � � � � � � � � _daoSectionHandlers.Add("SqlMap", DaoSessionHandlerFactory.GetDaoSessionHandler("SqlMap"));
+� � � � � � � � � � � � _daoSectionHandlers.Add("NHibernate", DaoSessionHandlerFactory.GetDaoSessionHandler("NHibernate"));

�� � � � � � � � � � � � _useConfigFileWatcher = useConfigFileWatcher;

@@ -243,7 +244,7 @@
�� � � � � � � � � � � � � � � � #region DaoSessionHandler

�� � � � � � � � � � � � � � � � XmlNode nodeSessionHandler = node.SelectSingleNode("daoSessionHandler");
-� � � � � � � � � � � � � � � � Hashtable properties = new Hashtable();
+� � � � � � � � � � � � � � � � IDictionary properties = new Hashtable();
�� � � � � � � � � � � � � � � � // By default, add the DataSource
�� � � � � � � � � � � � � � � � properties.Add( "DataSource", daoManager.DataSource);
�� � � � � � � � � � � � � � � � // By default, add the useConfigFileWatcher
@@ -258,10 +259,10 @@
�� � � � � � � � � � � � � � � � � � � � sessionHandler = (IDaoSessionHandler)_daoSectionHandlers[nodeSessionHandler.Attributes["name"].Value];

�� � � � � � � � � � � � � � � � � � � � // Parse property node
-� � � � � � � � � � � � � � � � � � � � XmlNode nodeProperty= nodeSessionHandler.SelectSingleNode("property");
-� � � � � � � � � � � � � � � � � � � � if (nodeProperty != null)
+� � � � � � � � � � � � � � � � � � � � foreach(XmlNode nodeProperty in nodeSessionHandler.SelectNodes("property"))
�� � � � � � � � � � � � � � � � � � � � {
-� � � � � � � � � � � � � � � � � � � � � � � � properties.Add(nodeProperty.Attributes["name"].Value, nodeProperty.Attributes["value"].Value);
+� � � � � � � � � � � � � � � � � � � � � � � � properties.Add(nodeProperty.Attributes["name"].Value,
+� � � � � � � � � � � � � � � � � � � � � � � � � � � � Resources.ParsePropertyTokens(nodeProperty.Attributes["value"].Value, _properties));
�� � � � � � � � � � � � � � � � � � � � }
�� � � � � � � � � � � � � � � � }
�� � � � � � � � � � � � � � � � else

Modified: Source1/IBatisNet.DataAccess/DaoSession.cs
===================================================================
--- Source1/IBatisNet.DataAccess/DaoSession.cs� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.DataAccess/DaoSession.cs� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -41,9 +41,26 @@
�� � � � /// <summary>
�� � � � /// Abstract definition of a DataAccess Session
�� � � � /// </summary>
-� � � � public abstract class DaoSession : IDaoSession, IDalSession
+� � � � public abstract class DaoSession : IDalSession
�� � � � {

+� � � � � � � � #region Fields
+� � � � � � � � protected DaoManager daoManager = null;
+� � � � � � � � #endregion
+
+� � � � � � � � #region Constructor (s) / Destructor
+� � � � � � � � /// <summary>
+� � � � � � � � /// The DaoManager that manages this Dao instance will be passed
+� � � � � � � � /// in as the parameter to this constructor automatically upon
+� � � � � � � � /// instantiation.
+� � � � � � � � /// </summary>
+� � � � � � � � /// <param name="daoManager"></param>
+� � � � � � � � public DaoSession(DaoManager daoManager)
+� � � � � � � � {
+� � � � � � � � � � � � this.daoManager = daoManager;
+� � � � � � � � }
+� � � � � � � � #endregion
+
�� � � � � � � � #region IDalSession Members

�� � � � � � � � #region Properties
@@ -71,6 +88,7 @@

�� � � � � � � � #region Methods

+
�� � � � � � � � /// <summary>
�� � � � � � � � /// Opens a database connection.
�� � � � � � � � /// </summary>
@@ -125,15 +143,6 @@

�� � � � � � � � #endregion

-� � � � � � � � #region IDaoSession Members
-
-� � � � � � � � #region Methods
-� � � � � � � � public abstract void InitDaoSession(DaoManager daoManager);
-
-� � � � � � � � #endregion
-
-� � � � � � � � #endregion
-
�� � � � � � � � #region IDisposable Members

�� � � � � � � � #region Methods

Modified: Source1/IBatisNet.DataAccess/DaoSessionHandlers/DaoSessionHandlerFactory.cs
===================================================================
--- Source1/IBatisNet.DataAccess/DaoSessionHandlers/DaoSessionHandlerFactory.cs� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.DataAccess/DaoSessionHandlers/DaoSessionHandlerFactory.cs� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -47,6 +47,7 @@
�� � � � � � � � {
�� � � � � � � � � � � � _daoSessionHandlerMap.Add("ADONET", new SimpleDaoSessionHandler());
�� � � � � � � � � � � � _daoSessionHandlerMap.Add("SqlMap", new SqlMapDaoSessionHandler());
+� � � � � � � � � � � � _daoSessionHandlerMap.Add("NHibernate", new NHibernateDaoSessionHandler());
�� � � � � � � � }

�� � � � � � � � static public IDaoSessionHandler GetDaoSessionHandler(string name)

Modified: Source1/IBatisNet.DataAccess/DaoSessionHandlers/NHibernateDaoSession.cs
===================================================================
--- Source1/IBatisNet.DataAccess/DaoSessionHandlers/NHibernateDaoSession.cs� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.DataAccess/DaoSessionHandlers/NHibernateDaoSession.cs� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -111,7 +111,6 @@
�� � � � {
�� � � � � � � � #region Fields
�� � � � � � � � private ISessionFactory _factory = null;
-� � � � � � � � private DaoManager _daoManager = null;
�� � � � � � � � private ISession _session = null;
�� � � � � � � � private ITransaction _transaction = null;
�� � � � � � � � private bool _consistent = false;
@@ -119,6 +118,12 @@
�� � � � � � � � #endregion

�� � � � � � � � #region Properties
+
+� � � � � � � � public ISession Session
+� � � � � � � � {
+� � � � � � � � � � � � get { return _session; }
+� � � � � � � � }
+
�� � � � � � � � public ISessionFactory Factory
�� � � � � � � � {
�� � � � � � � � � � � � get { return _factory; }
@@ -145,19 +150,14 @@
�� � � � � � � � #endregion

�� � � � � � � � #region Constructor (s) / Destructor
-� � � � � � � � public NHibernateDaoSession(DaoManager daoManager, ISessionFactory factory)
-� � � � � � � � {
-� � � � � � � � � � � � this.InitDaoSession( daoManager );
+� � � � � � � � public NHibernateDaoSession(DaoManager daoManager, ISessionFactory factory):base(daoManager)
+� � � � � � � � {
�� � � � � � � � � � � � _factory = factory;
�� � � � � � � � }
�� � � � � � � � #endregion

�� � � � � � � � #region Methods

-� � � � � � � � public override void InitDaoSession(DaoManager daoManager)
-� � � � � � � � {
-� � � � � � � � � � � � _daoManager = daoManager;
-� � � � � � � � }

�� � � � � � � � /// <summary>
�� � � � � � � � /// Opens a database connection.
@@ -172,7 +172,7 @@
�� � � � � � � � /// </summary>
�� � � � � � � � public override void CloseConnection()
�� � � � � � � � {
-� � � � � � � � � � � � _session.Flush();// or flush ?
+� � � � � � � � � � � � _session.Flush();// or Close ?
�� � � � � � � � }

�� � � � � � � � /// <summary>

Modified: Source1/IBatisNet.DataAccess/DaoSessionHandlers/NHibernateDaoSessionHandler.cs
===================================================================
--- Source1/IBatisNet.DataAccess/DaoSessionHandlers/NHibernateDaoSessionHandler.cs� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.DataAccess/DaoSessionHandlers/NHibernateDaoSessionHandler.cs� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -59,21 +59,33 @@

�� � � � � � � � }

-� � � � � � � � public void Configure(Hashtable properties)
+� � � � � � � � public void Configure(IDictionary properties)
�� � � � � � � � {
+� � � � � � � � � � � � string mapping = string.Empty;
+
�� � � � � � � � � � � � try
�� � � � � � � � � � � � {
�� � � � � � � � � � � � � � � � NHibernate.Cfg.Configuration config = new NHibernate.Cfg.Configuration();

�� � � � � � � � � � � � � � � � foreach(DictionaryEntry entry in properties)
�� � � � � � � � � � � � � � � � {
-� � � � � � � � � � � � � � � � � � � � if ((entry.Key as string).StartsWith("class."))
+
+� � � � � � � � � � � � � � � � � � � � if ((entry.Key.ToString()).StartsWith("class."))
�� � � � � � � � � � � � � � � � � � � � {
-� � � � � � � � � � � � � � � � � � � � � � � � config.AddClass(Resources.TypeForName(entry.Value as string));
+� � � � � � � � � � � � � � � � � � � � � � � � config.AddClass( Resources.TypeForName( entry.Value.ToString() ) );
�� � � � � � � � � � � � � � � � � � � � }
+� � � � � � � � � � � � � � � � � � � � if ((entry.Key.ToString())=="mapping")
+� � � � � � � � � � � � � � � � � � � � {
+� � � � � � � � � � � � � � � � � � � � � � � � mapping = entry.Value.ToString();
+� � � � � � � � � � � � � � � � � � � � }
+
+� � � � � � � � � � � � � � � � � � � � config.SetProperty( entry.Key.ToString(), entry.Value.ToString() );
�� � � � � � � � � � � � � � � � }

-� � � � � � � � � � � � � � � � config.Properties = properties;
+� � � � � � � � � � � � � � � � if (mapping.Length>0)
+� � � � � � � � � � � � � � � � {
+� � � � � � � � � � � � � � � � � � � � config.AddAssembly(mapping);
+� � � � � � � � � � � � � � � � }
�� � � � � � � � � � � � � � � � _factory = config.BuildSessionFactory();
�� � � � � � � � � � � � }
�� � � � � � � � � � � � catch(Exception e)

Modified: Source1/IBatisNet.DataAccess/DaoSessionHandlers/SimpleDaoSession.cs
===================================================================
--- Source1/IBatisNet.DataAccess/DaoSessionHandlers/SimpleDaoSession.cs� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.DataAccess/DaoSessionHandlers/SimpleDaoSession.cs� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -53,7 +53,6 @@
�� � � � � � � � private DataSource _dataSource = null;
�� � � � � � � � private bool _isOpenTransaction = false;
�� � � � � � � � private bool _consistent = false;
-� � � � � � � � private DaoManager _daoManager = null;

�� � � � � � � � /// <summary>
�� � � � � � � � /// Holds value of connection
@@ -93,18 +92,13 @@
�� � � � � � � � #endregion

�� � � � � � � � #region Constructor (s) / Destructor
-� � � � � � � � public SimpleDaoSession(DaoManager daoManager, DataSource dataSource)
+� � � � � � � � public SimpleDaoSession(DaoManager daoManager, DataSource dataSource):base(daoManager)
�� � � � � � � � {
-� � � � � � � � � � � � this.InitDaoSession( daoManager );
�� � � � � � � � � � � � _dataSource = dataSource;
�� � � � � � � � }
�� � � � � � � � #endregion

�� � � � � � � � #region Methods
-� � � � � � � � public override void InitDaoSession(DaoManager daoManager)
-� � � � � � � � {
-� � � � � � � � � � � � _daoManager = daoManager;
-� � � � � � � � }

�� � � � � � � � /// <summary>
�� � � � � � � � /// Opens a database connection.
@@ -295,20 +289,20 @@
�� � � � � � � � � � � � {
�� � � � � � � � � � � � � � � � if (_connection.State != ConnectionState.Closed)
�� � � � � � � � � � � � � � � � {
-� � � � � � � � � � � � � � � � � � � � _daoManager.CloseConnection();
+� � � � � � � � � � � � � � � � � � � � daoManager.CloseConnection();
�� � � � � � � � � � � � � � � � }
�� � � � � � � � � � � � }
�� � � � � � � � � � � � else
�� � � � � � � � � � � � {
�� � � � � � � � � � � � � � � � if (_consistent)
�� � � � � � � � � � � � � � � � {
-� � � � � � � � � � � � � � � � � � � � _daoManager.CommitTransaction();
+� � � � � � � � � � � � � � � � � � � � daoManager.CommitTransaction();
�� � � � � � � � � � � � � � � � }
�� � � � � � � � � � � � � � � � else
�� � � � � � � � � � � � � � � � {
�� � � � � � � � � � � � � � � � � � � � if (_connection.State != ConnectionState.Closed)
�� � � � � � � � � � � � � � � � � � � � {
-� � � � � � � � � � � � � � � � � � � � � � � � _daoManager.RollBackTransaction();
+� � � � � � � � � � � � � � � � � � � � � � � � daoManager.RollBackTransaction();
�� � � � � � � � � � � � � � � � � � � � }
�� � � � � � � � � � � � � � � � }
�� � � � � � � � � � � � }

Modified: Source1/IBatisNet.DataAccess/DaoSessionHandlers/SimpleDaoSessionHandler.cs
===================================================================
--- Source1/IBatisNet.DataAccess/DaoSessionHandlers/SimpleDaoSessionHandler.cs� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.DataAccess/DaoSessionHandlers/SimpleDaoSessionHandler.cs� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -44,7 +44,7 @@
�� � � � {
�� � � � � � � � private DataSource _dataSource;

-� � � � � � � � public void Configure(Hashtable properties)
+� � � � � � � � public void Configure(IDictionary properties)
�� � � � � � � � {
�� � � � � � � � � � � � _dataSource = (DataSource) properties["DataSource"];
�� � � � � � � � }

Modified: Source1/IBatisNet.DataAccess/DaoSessionHandlers/SqlMapDaoSession.cs
===================================================================
--- Source1/IBatisNet.DataAccess/DaoSessionHandlers/SqlMapDaoSession.cs� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.DataAccess/DaoSessionHandlers/SqlMapDaoSession.cs� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -46,7 +46,6 @@
�� � � � {
�� � � � � � � � #region Fields
�� � � � � � � � private SqlMapper _sqlMap = null;
-� � � � � � � � private DaoManager _daoManager = null;
�� � � � � � � � #endregion

�� � � � � � � � #region Properties
@@ -73,20 +72,14 @@
�� � � � � � � � #endregion

�� � � � � � � � #region Constructor (s) / Destructor
-� � � � � � � � public SqlMapDaoSession(DaoManager daoManager, SqlMapper sqlMap)
+� � � � � � � � public SqlMapDaoSession(DaoManager daoManager, SqlMapper sqlMap):base(daoManager)
�� � � � � � � � {
-� � � � � � � � � � � � this.InitDaoSession( daoManager );
�� � � � � � � � � � � � _sqlMap = sqlMap;
�� � � � � � � � }
�� � � � � � � � #endregion

�� � � � � � � � #region Methods

-� � � � � � � � public override void InitDaoSession(DaoManager daoManager)
-� � � � � � � � {
-� � � � � � � � � � � � _daoManager = daoManager;
-� � � � � � � � }
-
�� � � � � � � � /// <summary>
�� � � � � � � � /// Opens a database connection.
�� � � � � � � � /// </summary>

Modified: Source1/IBatisNet.DataAccess/DaoSessionHandlers/SqlMapDaoSessionHandler.cs
===================================================================
--- Source1/IBatisNet.DataAccess/DaoSessionHandlers/SqlMapDaoSessionHandler.cs� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.DataAccess/DaoSessionHandlers/SqlMapDaoSessionHandler.cs� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -58,7 +58,7 @@
�� � � � � � � � {
�� � � � � � � � }

-� � � � � � � � public void Configure(Hashtable properties)
+� � � � � � � � public void Configure(IDictionary properties)
�� � � � � � � � {
�� � � � � � � � � � � � try
�� � � � � � � � � � � � {

Modified: Source1/IBatisNet.DataAccess/IBatisNet.DataAccess.csproj
===================================================================
--- Source1/IBatisNet.DataAccess/IBatisNet.DataAccess.csproj� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.DataAccess/IBatisNet.DataAccess.csproj� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -104,6 +104,11 @@
� � � � � � � � � � �AssemblyName = "NHibernate"
� � � � � � � � � � �HintPath = "..\External-Bin\Net\1.1\NHibernate.dll"
� � � � � � � � �/>
+ � � � � � � � �<Reference
+ � � � � � � � � � �Name = "HashCodeProvider"
+ � � � � � � � � � �AssemblyName = "HashCodeProvider"
+ � � � � � � � � � �HintPath = "..\External-Bin\Net\1.1\HashCodeProvider.dll"
+ � � � � � � � �/>
� � � � � � �</References>
� � � � �</Build>
� � � � �<Files>
@@ -200,11 +205,6 @@
� � � � � � � � � � �BuildAction = "Compile"
� � � � � � � � �/>
� � � � � � � � �<File
- � � � � � � � � � �RelPath = "Interfaces\IDaoSession.cs"
- � � � � � � � � � �SubType = "Code"
- � � � � � � � � � �BuildAction = "Compile"
- � � � � � � � �/>
- � � � � � � � �<File
� � � � � � � � � � �RelPath = "Interfaces\IDaoSessionHandler.cs"
� � � � � � � � � � �SubType = "Code"
� � � � � � � � � � �BuildAction = "Compile"

Deleted: Source1/IBatisNet.DataAccess/Interfaces/IDaoSession.cs
===================================================================
--- Source1/IBatisNet.DataAccess/Interfaces/IDaoSession.cs� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.DataAccess/Interfaces/IDaoSession.cs� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -1,45 +0,0 @@
-
-#region Apache Notice
-/*****************************************************************************
- * $Header: $
- * $Revision: $
- * $Date: $
- *
- * iBATIS.NET Data Mapper
- * Copyright (C) 2004 - Gilles Bayon
- *
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * � � �http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ********************************************************************************/
-#endregion
-
-#region Imports
-using System;
-using System.Data;
-
-using IBatisNet.Common;
-using IBatisNet.DataAccess.Interfaces;
-#endregion
-
-
-namespace IBatisNet.DataAccess.Interfaces
-{
-� � � � /// <summary>
-� � � � /// Summary description for IDaoSession.
-� � � � /// </summary>
-� � � � public interface IDaoSession
-� � � � {
-� � � � � � � � void InitDaoSession(DaoManager daoManager);
-� � � � }
-}

Modified: Source1/IBatisNet.DataAccess/Interfaces/IDaoSessionHandler.cs
===================================================================
--- Source1/IBatisNet.DataAccess/Interfaces/IDaoSessionHandler.cs� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.DataAccess/Interfaces/IDaoSessionHandler.cs� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -40,6 +40,6 @@
�� � � � public interface IDaoSessionHandler
�� � � � {
�� � � � � � � � DaoSession GetDaoSession(DaoManager daoManager);
-� � � � � � � � void Configure(Hashtable properties);
+� � � � � � � � void Configure(IDictionary properties);
�� � � � }
�}

Added: Source1/IBatisNet.Test/Dao/Implementations/Ado/UserDao.cs
===================================================================
--- Source1/IBatisNet.Test/Dao/Implementations/Ado/UserDao.cs� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.Test/Dao/Implementations/Ado/UserDao.cs� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -0,0 +1,77 @@
+using System;
+
+using IBatisNet.DataAccess;
+using IBatisNet.DataAccess.Exceptions;
+using IBatisNet.DataAccess.Interfaces;
+
+using IBatisNet.Test.Interfaces;
+using IBatisNet.Test.Implementations;
+
+using IBatisNet.Test.Domain;
+
+namespace IBatisNet.Test.Dao.Implementations.Ado
+{
+� � � � /// <summary>
+� � � � /// Summary description for UserDao.
+� � � � /// </summary>
+� � � � public class UserDao : BaseDao, IUserDao
+� � � � {
+� � � � � � � � /// <summary>
+� � � � � � � � /// Create an account
+� � � � � � � � /// </summary>
+� � � � � � � � /// <param name="account">The account to create</param>
+� � � � � � � � public void Create(Account account)
+� � � � � � � � {
+� � � � � � � � � � � � IDbCommand command = null;
+� � � � � � � � � � � � DaoSession daoSession = null;
+
+� � � � � � � � � � � � daoSession = this.GetContext();
+
+� � � � � � � � � � � � command = daoSession.CreateCommand(CommandType.Text);
+
+� � � � � � � � � � � � try
+� � � � � � � � � � � � {
+� � � � � � � � � � � � � � � � if (daoSession.DataSource.Provider.UseParameterPrefixInSql)
+� � � � � � � � � � � � � � � � {
+� � � � � � � � � � � � � � � � � � � � command.CommandText = INSERT_ACCOUNT;
+� � � � � � � � � � � � � � � � }
+� � � � � � � � � � � � � � � � else
+� � � � � � � � � � � � � � � � {
+� � � � � � � � � � � � � � � � � � � � command.CommandText = OLEDB_INSERT_ACCOUNT;
+� � � � � � � � � � � � � � � � }
+
+� � � � � � � � � � � � � � � � IDbDataParameter sqlParameter = command.CreateParameter();
+� � � � � � � � � � � � � � � � sqlParameter.ParameterName = PARAM_ACCOUNT_ID;
+� � � � � � � � � � � � � � � � sqlParameter.Value = account.Id;
+� � � � � � � � � � � � � � � � command.Parameters.Add( �sqlParameter );
+
+� � � � � � � � � � � � � � � � sqlParameter = command.CreateParameter();
+� � � � � � � � � � � � � � � � sqlParameter.ParameterName = PARAM_ACCOUNT_FIRSTNAME;
+� � � � � � � � � � � � � � � � sqlParameter.Value = account.FirstName;
+� � � � � � � � � � � � � � � � command.Parameters.Add( �sqlParameter );
+
+� � � � � � � � � � � � � � � � sqlParameter = command.CreateParameter();
+� � � � � � � � � � � � � � � � sqlParameter.ParameterName = PARAM_ACCOUNT_LASTNAME;
+� � � � � � � � � � � � � � � � sqlParameter.Value = account.LastName;
+� � � � � � � � � � � � � � � � command.Parameters.Add( �sqlParameter );
+
+� � � � � � � � � � � � � � � � sqlParameter = command.CreateParameter();
+� � � � � � � � � � � � � � � � sqlParameter.ParameterName = PARAM_ACCOUNT_EMAIL;
+� � � � � � � � � � � � � � � � sqlParameter.Value = account.EmailAddress;
+� � � � � � � � � � � � � � � � command.Parameters.Add( �sqlParameter );
+
+� � � � � � � � � � � � � � � � command.ExecuteNonQuery();
+
+� � � � � � � � � � � � � � � � command.Parameters.Clear();
+� � � � � � � � � � � � }
+� � � � � � � � � � � � catch (System.Exception e)
+� � � � � � � � � � � � {
+� � � � � � � � � � � � � � � � throw new DataAccessException("Error executing SqlAccountDao.Create. Cause :" + e.Message, e);
+� � � � � � � � � � � � }
+� � � � � � � � � � � � finally
+� � � � � � � � � � � � {
+� � � � � � � � � � � � � � � � command.Dispose();
+� � � � � � � � � � � � }
+� � � � � � � � }
+� � � � }
+}

Added: Source1/IBatisNet.Test/Dao/Implementations/NHibernate/UserDao.cs
===================================================================
--- Source1/IBatisNet.Test/Dao/Implementations/NHibernate/UserDao.cs� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.Test/Dao/Implementations/NHibernate/UserDao.cs� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -0,0 +1,68 @@
+using System;
+
+using IBatisNet.DataMapper;
+using IBatisNet.DataAccess.DaoSessionHandlers; // NHibernateDaoSession
+using IBatisNet.DataAccess.Exceptions;
+
+// Domain Dao
+using IBatisNet.Test.Interfaces; // IUserDao
+using IBatisNet.Test.Implementations; // BaseDao
+
+using IBatisNet.Test.Domain;
+
+using NHibernate;
+
+namespace IBatisNet.Test.Dao.Implementations.NHibernate
+{
+� � � � /// <summary>
+� � � � /// Summary description for UserDao.
+� � � � /// </summary>
+� � � � public class UserDao : BaseDao, IUserDao
+� � � � {
+� � � � � � � � /// <summary>
+� � � � � � � � /// Create an user
+� � � � � � � � /// </summary>
+� � � � � � � � /// <param name="user">The user to create</param>
+� � � � � � � � public void Create(User user)
+� � � � � � � � {
+� � � � � � � � � � � � NHibernateDaoSession nHibernateDaoSession = null;
+
+� � � � � � � � � � � � try
+� � � � � � � � � � � � {
+� � � � � � � � � � � � � � � � nHibernateDaoSession = (NHibernateDaoSession)this.GetContext();
+
+� � � � � � � � � � � � � � � � ISession session = nHibernateDaoSession.Session;
+
+� � � � � � � � � � � � � � � � session.Save( user );
+� � � � � � � � � � � � }
+� � � � � � � � � � � � catch(DataAccessException ex)
+� � � � � � � � � � � � {
+� � � � � � � � � � � � � � � � throw new DataAccessException("Error executing UserDao.Create. Cause :" +ex.Message,ex);
+� � � � � � � � � � � � }
+� � � � � � � � }
+
+� � � � � � � � /// <summary>
+� � � � � � � � /// Load a user
+� � � � � � � � /// </summary>
+� � � � � � � � public User Load(string id)
+� � � � � � � � {
+� � � � � � � � � � � � NHibernateDaoSession nHibernateDaoSession = null;
+� � � � � � � � � � � � User user = null;
+
+� � � � � � � � � � � � try
+� � � � � � � � � � � � {
+� � � � � � � � � � � � � � � � nHibernateDaoSession = (NHibernateDaoSession)this.GetContext();
+
+� � � � � � � � � � � � � � � � ISession session = nHibernateDaoSession.Session;
+
+� � � � � � � � � � � � � � � � user = session.Load(typeof(User),id) as User;
+� � � � � � � � � � � � }
+� � � � � � � � � � � � catch(DataAccessException ex)
+� � � � � � � � � � � � {
+� � � � � � � � � � � � � � � � throw new DataAccessException("Error executing UserDao.Create. Cause :" +ex.Message,ex);
+� � � � � � � � � � � � }
+
+� � � � � � � � � � � � return user;
+� � � � � � � � }
+� � � � }
+}

Added: Source1/IBatisNet.Test/Dao/Interfaces/IUserDao.cs
===================================================================
--- Source1/IBatisNet.Test/Dao/Interfaces/IUserDao.cs� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.Test/Dao/Interfaces/IUserDao.cs� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -0,0 +1,23 @@
+using System;
+
+using IBatisNet.Test.Domain;
+
+namespace IBatisNet.Test.Interfaces
+{
+� � � � /// <summary>
+� � � � /// Summary description for IuserDao.
+� � � � /// </summary>
+� � � � public interface IUserDao
+� � � � {
+� � � � � � � � /// <summary>
+� � � � � � � � /// Create an user
+� � � � � � � � /// </summary>
+� � � � � � � � /// <param name="user">The user to create</param>
+� � � � � � � � void Create(User user);
+
+� � � � � � � � /// <summary>
+� � � � � � � � /// Load a user
+� � � � � � � � /// </summary>
+� � � � � � � � User Load(string id);
+� � � � }
+}

Added: Source1/IBatisNet.Test/Dao/Interfaces/IuserDao.cs
===================================================================
--- Source1/IBatisNet.Test/Dao/Interfaces/IuserDao.cs� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.Test/Dao/Interfaces/IuserDao.cs� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -0,0 +1,23 @@
+using System;
+
+using IBatisNet.Test.Domain;
+
+namespace IBatisNet.Test.Interfaces
+{
+� � � � /// <summary>
+� � � � /// Summary description for IuserDao.
+� � � � /// </summary>
+� � � � public interface IUserDao
+� � � � {
+� � � � � � � � /// <summary>
+� � � � � � � � /// Create an user
+� � � � � � � � /// </summary>
+� � � � � � � � /// <param name="user">The user to create</param>
+� � � � � � � � void Create(User user);
+
+� � � � � � � � /// <summary>
+� � � � � � � � /// Load a user
+� � � � � � � � /// </summary>
+� � � � � � � � User Load(string id);
+� � � � }
+}

Added: Source1/IBatisNet.Test/Domain/User.cs
===================================================================
--- Source1/IBatisNet.Test/Domain/User.cs� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.Test/Domain/User.cs� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -0,0 +1,52 @@
+using System;
+
+namespace IBatisNet.Test.Domain
+{
+� � � � /// <summary>
+� � � � /// Summary description for User.
+� � � � /// </summary>
+� � � � public class User
+� � � � {
+� � � � � � � � private string id;
+� � � � � � � � private string userName;
+� � � � � � � � private string password;
+� � � � � � � � private string emailAddress;
+� � � � � � � � private DateTime lastLogon;
+
+
+� � � � � � � � public User()
+� � � � � � � � {
+� � � � � � � � }
+
+� � � � � � � � public string Id
+� � � � � � � � {
+� � � � � � � � � � � � get { return id; }
+� � � � � � � � � � � � set { id = value; }
+� � � � � � � � }
+
+� � � � � � � � public string UserName
+� � � � � � � � {
+� � � � � � � � � � � � get { return userName; }
+� � � � � � � � � � � � set { userName = value; }
+� � � � � � � � }
+
+� � � � � � � � public string Password
+� � � � � � � � {
+� � � � � � � � � � � � get { return password; }
+� � � � � � � � � � � � set { password = value; }
+� � � � � � � � }
+
+� � � � � � � � public string EmailAddress
+� � � � � � � � {
+� � � � � � � � � � � � get { return emailAddress; }
+� � � � � � � � � � � � set { emailAddress = value; }
+� � � � � � � � }
+
+� � � � � � � � public DateTime LastLogon
+� � � � � � � � {
+� � � � � � � � � � � � get { return lastLogon; }
+� � � � � � � � � � � � set { lastLogon = value; }
+� � � � � � � � }
+
+� � � � }
+}

Modified: Source1/IBatisNet.Test/IBatisNet.Test.csproj
===================================================================
--- Source1/IBatisNet.Test/IBatisNet.Test.csproj� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.Test/IBatisNet.Test.csproj� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -120,6 +120,11 @@
� � � � � � � � � � �HintPath = "G:\Program Files\NUnit 2.2\bin\nunit.framework.dll"
� � � � � � � � � � �AssemblyFolderKey = "hklm\dn\nunit.framework"
� � � � � � � � �/>
+ � � � � � � � �<Reference
+ � � � � � � � � � �Name = "NHibernate"
+ � � � � � � � � � �AssemblyName = "NHibernate"
+ � � � � � � � � � �HintPath = "..\External-Bin\Net\1.1\NHibernate.dll"
+ � � � � � � � �/>
� � � � � � �</References>
� � � � �</Build>
� � � � �<Files>
@@ -154,6 +159,10 @@
� � � � � � � � � � �BuildAction = "Content"
� � � � � � � � �/>
� � � � � � � � �<File
+ � � � � � � � � � �RelPath = "User.hbm.xml"
+ � � � � � � � � � �BuildAction = "EmbeddedResource"
+ � � � � � � � �/>
+ � � � � � � � �<File
� � � � � � � � � � �RelPath = "bin\Debug\dao_MSSQL_Odbc.config"
� � � � � � � � � � �BuildAction = "None"
� � � � � � � � �/>
@@ -205,11 +214,21 @@
� � � � � � � � � � �BuildAction = "Compile"
� � � � � � � � �/>
� � � � � � � � �<File
+ � � � � � � � � � �RelPath = "Dao\Implementations\NHibernate\UserDao.cs"
+ � � � � � � � � � �SubType = "Code"
+ � � � � � � � � � �BuildAction = "Compile"
+ � � � � � � � �/>
+ � � � � � � � �<File
� � � � � � � � � � �RelPath = "Dao\Interfaces\IAccountDao.cs"
� � � � � � � � � � �SubType = "Code"
� � � � � � � � � � �BuildAction = "Compile"
� � � � � � � � �/>
� � � � � � � � �<File
+ � � � � � � � � � �RelPath = "Dao\Interfaces\IUserDao.cs"
+ � � � � � � � � � �SubType = "Code"
+ � � � � � � � � � �BuildAction = "Compile"
+ � � � � � � � �/>
+ � � � � � � � �<File
� � � � � � � � � � �RelPath = "Domain\Account.cs"
� � � � � � � � � � �SubType = "Code"
� � � � � � � � � � �BuildAction = "Compile"
@@ -260,6 +279,11 @@
� � � � � � � � � � �BuildAction = "Compile"
� � � � � � � � �/>
� � � � � � � � �<File
+ � � � � � � � � � �RelPath = "Domain\User.cs"
+ � � � � � � � � � �SubType = "Code"
+ � � � � � � � � � �BuildAction = "Compile"
+ � � � � � � � �/>
+ � � � � � � � �<File
� � � � � � � � � � �RelPath = "Maps\Access\OleDb\Account.xml"
� � � � � � � � � � �BuildAction = "Content"
� � � � � � � � �/>
@@ -442,6 +466,11 @@
� � � � � � � � � � �BuildAction = "Compile"
� � � � � � � � �/>
� � � � � � � � �<File
+ � � � � � � � � � �RelPath = "NUnit\DaoTests\NHibernateDaoTest.cs"
+ � � � � � � � � � �SubType = "Code"
+ � � � � � � � � � �BuildAction = "Compile"
+ � � � � � � � �/>
+ � � � � � � � �<File
� � � � � � � � � � �RelPath = "NUnit\DaoTests\SqlMapDaoTest.cs"
� � � � � � � � � � �SubType = "Code"
� � � � � � � � � � �BuildAction = "Compile"
@@ -556,6 +585,10 @@
� � � � � � � � � � �BuildAction = "Content"
� � � � � � � � �/>
� � � � � � � � �<File
+ � � � � � � � � � �RelPath = "Scripts\MSSQL\user-init.sql"
+ � � � � � � � � � �BuildAction = "Content"
+ � � � � � � � �/>
+ � � � � � � � �<File
� � � � � � � � � � �RelPath = "Scripts\MySql\DataBase.sql"
� � � � � � � � � � �BuildAction = "Content"
� � � � � � � � �/>

Added: Source1/IBatisNet.Test/NUnit/DaoTests/NHibernateDaoTest.cs
===================================================================
--- Source1/IBatisNet.Test/NUnit/DaoTests/NHibernateDaoTest.cs� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.Test/NUnit/DaoTests/NHibernateDaoTest.cs� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -0,0 +1,128 @@
+using System;
+using System.IO;
+using System.Configuration;
+
+using IBatisNet.DataAccess;
+using IBatisNet.Common; // DataSource definition
+using IBatisNet.Common.Utilities; // ScriptRunner definition
+
+using IBatisNet.Test.Interfaces;
+
+using IBatisNet.Test.NUnit;
+using IBatisNet.Test.Domain;
+
+using NUnit.Framework;
+
+namespace IBatisNet.Test.NUnit.DaoTests
+{
+� � � � /// <summary>
+� � � � /// Summary description for NHibernateDaoTest.
+� � � � /// </summary>
+� � � � [TestFixture]
+� � � � public class NHibernateDaoTest
+� � � � {
+� � � � � � � � /// <summary>
+� � � � � � � � /// A daoManager
+� � � � � � � � /// </summary>
+� � � � � � � � private static �DaoManager _daoManager = null;
+
+� � � � � � � � /// <summary>
+� � � � � � � � /// Initialisation
+� � � � � � � � /// </summary>
+� � � � � � � � [SetUp]
+� � � � � � � � public void SetUp()
+� � � � � � � � {
+� � � � � � � � � � � � string scriptDirectory = Resources.RootDirectory + Path.DirectorySeparatorChar +
+� � � � � � � � � � � � � � � � "Scripts" + Path.DirectorySeparatorChar +
+� � � � � � � � � � � � � � � � ConfigurationSettings.AppSettings["database"]+ Path.DirectorySeparatorChar;
+
+� � � � � � � � � � � � DaoManager.Configure( "dao"+ "_" + ConfigurationSettings.AppSettings["database"] + "_"
+� � � � � � � � � � � � � � � � + ConfigurationSettings.AppSettings["providerType"] + ".config" );
+
+� � � � � � � � � � � � _daoManager = DaoManager.GetInstance("NHibernateDao");
+
+� � � � � � � � � � � � InitScript( _daoManager.LocalDataSource, scriptDirectory + "user-init.sql" );
+� � � � � � � � }
+
+� � � � � � � � /// <summary>
+� � � � � � � � /// Run a sql batch for the datasource.
+� � � � � � � � /// </summary>
+� � � � � � � � /// <param name="datasource">The datasource.</param>
+� � � � � � � � /// <param name="script">The sql batch</param>
+� � � � � � � � protected static void InitScript(DataSource datasource, string script)
+� � � � � � � � {
+� � � � � � � � � � � � ScriptRunner runner = new ScriptRunner();
+
+� � � � � � � � � � � � runner.RunScript(datasource, script);
+� � � � � � � � }
+
+� � � � � � � � /// <summary>
+� � � � � � � � /// Test Create user
+� � � � � � � � /// </summary>
+� � � � � � � � [Test]
+� � � � � � � � public void TestCreateUser ()
+� � � � � � � � {
+� � � � � � � � � � � � IUserDao userDao = (IUserDao)_daoManager["User"];
+
+� � � � � � � � � � � � User newUser = new User();
+� � � � � � � � � � � � newUser.Id = "joe_cool";
+� � � � � � � � � � � � newUser.UserName = "Joseph Cool";
+� � � � � � � � � � � � newUser.Password = "abc123";
+� � � � � � � � � � � � newUser.EmailAddress = "joe@cool.com";
+� � � � � � � � � � � � newUser.LastLogon = DateTime.Now;
+
+� � � � � � � � � � � � try
+� � � � � � � � � � � � {
+� � � � � � � � � � � � � � � � _daoManager.OpenConnection();
+� � � � � � � � � � � � � � � � userDao.Create(newUser);
+� � � � � � � � � � � � }
+� � � � � � � � � � � � catch(Exception e)
+� � � � � � � � � � � � {
+� � � � � � � � � � � � � � � � // Ignore
+� � � � � � � � � � � � � � � � Console.WriteLine("TestCreateUser, error cause : "+e.Message);
+� � � � � � � � � � � � }
+� � � � � � � � � � � � finally
+� � � � � � � � � � � � {
+� � � � � � � � � � � � � � � � _daoManager.CloseConnection();
+� � � � � � � � � � � � }
+
+� � � � � � � � � � � � DateTime stamp = DateTime.Now;
+� � � � � � � � � � � � User joeCool = null;
+� � � � � � � � � � � � try
+� � � � � � � � � � � � {
+� � � � � � � � � � � � � � � � // open another session to retrieve the just inserted user
+� � � � � � � � � � � � � � � � _daoManager.OpenConnection();
+
+� � � � � � � � � � � � � � � � //The User object you get back is live!
+� � � � � � � � � � � � � � � � joeCool = userDao.Load("joe_cool");
+
+� � � � � � � � � � � � � � � � Assert.IsNotNull(joeCool);
+� � � � � � � � � � � � � � � � Assert.AreEqual("Joseph Cool", joeCool.UserName);
+
+� � � � � � � � � � � � � � � � //Change its properties and it will get persisted to the database on Close.
+� � � � � � � � � � � � � � � � // set Joe Cool's Last Login property
+� � � � � � � � � � � � � � � � joeCool.LastLogon = stamp;
+� � � � � � � � � � � � }
+� � � � � � � � � � � � catch(Exception e)
+� � � � � � � � � � � � {
+� � � � � � � � � � � � � � � � // Ignore
+� � � � � � � � � � � � � � � � Console.WriteLine("TestCreateUser, error cause : "+e.Message);
+� � � � � � � � � � � � }
+� � � � � � � � � � � � finally
+� � � � � � � � � � � � {
+� � � � � � � � � � � � � � � � // flush the changes from the Session to the Database
+� � � � � � � � � � � � � � � � _daoManager.CloseConnection();
+� � � � � � � � � � � � }
+
+� � � � � � � � � � � � _daoManager.OpenConnection();
+� � � � � � � � � � � � //The User object you get back is live!
+� � � � � � � � � � � � joeCool = userDao.Load("joe_cool");
+� � � � � � � � � � � � _daoManager.CloseConnection();
+
+� � � � � � � � � � � � Assert.IsNotNull(joeCool);
+� � � � � � � � � � � � Assert.AreEqual("Joseph Cool", joeCool.UserName);
+� � � � � � � � � � � � Assert.AreEqual(stamp.ToString(), joeCool.LastLogon.ToString());
+� � � � � � � � }
+
+� � � � }
+}

Added: Source1/IBatisNet.Test/Scripts/MSSQL/user-init.sql
===================================================================
--- Source1/IBatisNet.Test/Scripts/MSSQL/user-init.sql� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.Test/Scripts/MSSQL/user-init.sql� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -0,0 +1,17 @@
+-- Creating Table
+
+use [IBatisNet]
+
+if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Users]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
+BEGIN
+� � � � drop table [dbo].[Users]
+END
+
+CREATE TABLE [dbo].[Users] (
+ �LogonID nvarchar(20) NOT NULL default '0',
+ �Name nvarchar(40) default NULL,
+ �Password nvarchar(20) default NULL,
+ �EmailAddress nvarchar(40) default NULL,
+ �LastLogon datetime default NULL,
+ �PRIMARY KEY �(LogonID)
+)

Added: Source1/IBatisNet.Test/User.hbm.xml
===================================================================
--- Source1/IBatisNet.Test/User.hbm.xml� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.Test/User.hbm.xml� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
+� � � � <class name="IBatisNet.Test.Domain.User, IBatisNet.Test" table="users">
+� � � � � � � � <id name="Id" column="LogonId" type="String" length="20">
+� � � � � � � � � � � � <generator class="assigned" />
+� � � � � � � � </id>
+� � � � � � � � <property name="UserName" column= "Name" type="String" length="40"/>
+� � � � � � � � <property name="Password" type="String" length="20"/>
+� � � � � � � � <property name="EmailAddress" type="String" length="40"/>
+� � � � � � � � <property name="LastLogon" type="DateTime"/>
+� � � � </class>
+
+</hibernate-mapping>
\ No newline at end of file

Modified: Source1/IBatisNet.Test/bin/Debug/dao_MSSQL_SqlClient.config
===================================================================
--- Source1/IBatisNet.Test/bin/Debug/dao_MSSQL_SqlClient.config� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.Test/bin/Debug/dao_MSSQL_SqlClient.config� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -31,4 +31,27 @@
�� � � � � � � � � � � � <dao name="Account" implementation="IBatisNet.Test.Dao.Implementations.DataMapper.AccountDao, IBatisNet.Test"/>
�� � � � � � � � </daoFactory>
�� � � � </context>
+
+� � � � <context name="NHibernateDao">
+� � � � � � � � <properties resource="database.config"/>
+
+� � � � � � � � <daoSessionHandler name="NHibernate">
+� � � � � � � � � � � � <property name="hibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect"/>
+� � � � � � � � � � � � <property name="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
+� � � � � � � � � � � � <property name="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver"/>
+� � � � � � � � � � � � <property name="hibernate.connection.connection_string" value="data source=${datasource};database=${database};user id=${userid};password=${password};connection reset=false;connection lifetime=5; min pool size=1; max pool size=50"/>
+� � � � � � � � � � � � <property name="mapping" value="IBatisNet.Test"/>
+� � � � � � � � � � � � <property name="show_sql" value="false"/>
+� � � � � � � � � � � � <property name="use_outer_join" value="true"/>
+� � � � � � � � </daoSessionHandler>
+
+� � � � � � � � <database>
+� � � � � � � � � � � � <dataSource name="iBatisNet" connectionString="data source=${datasource};database=${database};user id=${userid};password=${password};connection reset=false;connection lifetime=5; min pool size=1; max pool size=50"/>
+� � � � � � � � � � � � <!-- Not yet implemented -->
+� � � � � � � � � � � � <transactionManager type="ADO/SWC"/>
+� � � � � � � � </database>
+� � � � � � � � <daoFactory>
+� � � � � � � � � � � � <dao name="User" implementation="IBatisNet.Test.Dao.Implementations.NHibernate.UserDao, IBatisNet.Test"/>
+� � � � � � � � </daoFactory>
+� � � � </context>
�</daoConfig>

Modified: Source1/IBatisNet.sln
===================================================================
--- Source1/IBatisNet.sln� � � � 2004-11-14 16:58:56 UTC (rev 355)
+++ Source1/IBatisNet.sln� � � � 2004-11-15 20:11:48 UTC (rev 356)
@@ -51,6 +51,7 @@
�� � � � � � � � External-Bin\Net\1.1\Apache.Avalon.DynamicProxy.dll = External-Bin\Net\1.1\Apache.Avalon.DynamicProxy.dll
�� � � � � � � � External-Bin\Net\1.1\ByteFX.MySqlClient.dll = External-Bin\Net\1.1\ByteFX.MySqlClient.dll
�� � � � � � � � IBatisNet.Schemas\DaoConfig.xsd = IBatisNet.Schemas\DaoConfig.xsd
+� � � � � � � � External-Bin\Net\1.1\HashCodeProvider.dll = External-Bin\Net\1.1\HashCodeProvider.dll
�� � � � � � � � ..\iBATIS.build = ..\iBATIS.build
�� � � � � � � � External-Bin\Net\1.1\ICSharpCode.SharpZipLib.dll = External-Bin\Net\1.1\ICSharpCode.SharpZipLib.dll
�� � � � � � � � External-Bin\Net\1.1\log4net.dll = External-Bin\Net\1.1\log4net.dll