You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ibatis.apache.org by gb...@apache.org on 2006/07/04 19:50:58 UTC
svn commit: r419056 [5/6] - in /ibatis/trunk/cs/tutorial2: ./ External-bin/
Files/ Files/Maps/ Files/Maps/Access/ Tutorial2.Application/
Tutorial2.Application/Properties/ Tutorial2.Application/bin/
Tutorial2.Domain/ Tutorial2.Domain/Properties/ Tutoria...
Added: ibatis/trunk/cs/tutorial2/Files/Blogs.mdb
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Files/Blogs.mdb?rev=419056&view=auto
==============================================================================
Binary file - no diff available.
Propchange: ibatis/trunk/cs/tutorial2/Files/Blogs.mdb
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: ibatis/trunk/cs/tutorial2/Files/Maps/Access/Author.xml
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Files/Maps/Access/Author.xml?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Files/Maps/Access/Author.xml (added)
+++ ibatis/trunk/cs/tutorial2/Files/Maps/Access/Author.xml Tue Jul 4 10:50:55 2006
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<sqlMap
+ namespace="Author"
+ xmlns="http://ibatis.apache.org/mapping"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <!-- XML document for the Author class. -->
+<alias>
+ <typeAlias alias="Author" type="Tutorial2.Domain.Author, Tutorial2.Domain" />
+ </alias>
+
+ <resultMaps>
+ <resultMap id="Author-Result" class="Author">
+ <result property="_id" column="AuthorID" />
+ <result property="Name" column="AuthorName" />
+ <result property="Login" column="AuthorLogin" />
+ <result property="Password" column="AuthorPassword" />
+ </resultMap>
+
+ <resultMap id="Author-Complete-Result" extends="Author-Result" class="Author">
+ <result property="Blog" resultMapping="Blog.Blog-Result"/>
+ </resultMap>
+ </resultMaps>
+
+ <statements>
+
+ <select id="Author-Select-Basic" parameterClass="int" resultMap="Author-Result">
+ SELECT
+ Authors.ID as AuthorID,
+ Authors.Name as AuthorName,
+ Authors.Login as AuthorLogin,
+ Authors.Password as AuthorPassword
+ FROM [Authors]
+ WHERE
+ ([ID] = #value#)
+ </select>
+
+ <select id="Base-Select" resultMap="Author-Complete-Result">
+ SELECT
+ Authors.ID as AuthorID,
+ Authors.Name as AuthorName,
+ Authors.Login as AuthorLogin,
+ Authors.Password as AuthorPassword,
+ Blogs.ID as BlogID,
+ Blogs.Name as BlogName,
+ Blogs.Description as BlogDescription
+ FROM [Authors], [Blogs]
+ </select>
+
+ <select id="Author-Select" extends="Base-Select" parameterClass="int" resultMap="Author-Complete-Result">
+ WHERE
+ ([Authors.ID] = #value#)
+ AND
+ ([Blogs.UserID] = [Authors.ID])
+ </select>
+
+
+ <select id="Author-Verify" extends="Base-Select" parameterClass="hashtable" resultMap="Author-Complete-Result">
+ WHERE
+ ([Authors.Login] = #Login#)
+ AND
+ ([Authors.Password] = #Password#)
+ AND
+ ([Blogs.UserID] = [Authors.ID])
+ </select>
+
+ <!-- INSERT -->
+ <insert id="Author-Insert" parameterClass="Author">
+ INSERT INTO [Authors] (
+ [Name],
+ [Login],
+ [Password]
+ ) VALUES (
+ #Name#,
+ #Login#,
+ #Password#
+ )
+
+ <selectKey resultClass="int" property="_id" type="post">
+ select @@IDENTITY
+ </selectKey>
+ </insert>
+
+ <update id="Author-Update" parameterClass="Author">
+ UPDATE [Authors] SET
+ [Name] = #Name#,
+ [Login] = #Login#,
+ [Password] = #Password#
+ WHERE
+ ([ID] = #Id#)
+ </update>
+
+ <delete id="Author-Delete" parameterClass="Author">
+ DELETE FROM [Authors]
+ WHERE
+ ([ID] = #Id#)
+ </delete>
+ </statements>
+</sqlMap>
\ No newline at end of file
Added: ibatis/trunk/cs/tutorial2/Files/Maps/Access/Blog.xml
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Files/Maps/Access/Blog.xml?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Files/Maps/Access/Blog.xml (added)
+++ ibatis/trunk/cs/tutorial2/Files/Maps/Access/Blog.xml Tue Jul 4 10:50:55 2006
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<sqlMap
+ namespace="Blog"
+ xmlns="http://ibatis.apache.org/mapping"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <alias>
+ <typeAlias alias="Blog" type="Tutorial2.Domain.Blog, Tutorial2.Domain" />
+ </alias>
+
+ <resultMaps>
+ <resultMap id="Blog-Result" class="Blog">
+ <result property="_id" column="BlogID" />
+ <result property="Name" column="BlogName" />
+ <result property="Description" column="BlogDescription" />
+ <result property="Posts" column="BlogID" lazyLoad="true" select="Post-Fill"/>
+ </resultMap>
+ </resultMaps>
+
+ <statements>
+
+ <select id="Blog-Select" parameterClass="map" resultMap="Blog-Result">
+ SELECT
+ Blogs.ID as BlogID,
+ Blogs.Name as BlogName,
+ Blogs.Description as BlogDescription
+ FROM [Blogs]
+ WHERE
+ ([ID] = #Id#)
+ </select>
+
+ <insert id="Blog-Insert" parameterClass="Blog">
+ INSERT INTO [Blogs] (
+ [UserId],
+ [Name],
+ [Description]
+ ) VALUES (
+ #Author.Id#,
+ #Name#,
+ #Description#
+ )
+
+ <selectKey resultClass="int" property="_id" type="post">
+ select @@IDENTITY
+ </selectKey>
+ </insert>
+
+
+ <update id="Blog-Update" parameterClass="Blog">
+ UPDATE [Blogs] SET
+ [Name] = #Name#,
+ [Description] = #Description#
+ WHERE
+ ([ID] = #Id#)
+ </update>
+
+
+ <delete id="Blog-Delete" parameterClass="Blog">
+ DELETE FROM [Blogs]
+ WHERE
+ ([ID] = #Id#)
+ </delete>
+ </statements>
+</sqlMap>
\ No newline at end of file
Added: ibatis/trunk/cs/tutorial2/Files/Maps/Access/Post.xml
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Files/Maps/Access/Post.xml?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Files/Maps/Access/Post.xml (added)
+++ ibatis/trunk/cs/tutorial2/Files/Maps/Access/Post.xml Tue Jul 4 10:50:55 2006
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<sqlMap
+ namespace="Post"
+ xmlns="http://ibatis.apache.org/mapping"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <alias>
+ <typeAlias alias="Post" type="Tutorial2.Domain.Post, Tutorial2.Domain" />
+ </alias>
+
+ <resultMaps>
+ <resultMap id="Post-Result" class="Post">
+ <result property="_id" column="ID" />
+ <result property="Title" column="Title" />
+ <result property="Content" column="Content" />
+ <result property="Date" column="Date" />
+ </resultMap>
+ </resultMaps>
+
+ <statements>
+
+ <select id="Post-Select" parameterClass="Post" resultMap="Post-Result">
+ SELECT *
+ FROM [Posts]
+ WHERE
+ ([ID] = #Id#)
+ </select>
+
+ <select id="Post-Fill" parameterClass="int" resultMap="Post-Result" >
+ SELECT *
+ FROM [Posts]
+ WHERE
+ ([BlogID] = #Id#)
+ </select>
+
+
+ <insert id="Post-Insert" parameterClass="Post">
+ INSERT INTO [Posts] (
+ [BlogID],
+ [Title],
+ [Content],
+ [Date]
+ ) VALUES (
+ #Blog.Id#,
+ #Title#,
+ #Content#,
+ #Date:Date#
+ )
+
+ <selectKey resultClass="int" property="_id" type="post">
+ select @@IDENTITY
+ </selectKey>
+ </insert>
+
+
+ <update id="Post-Update" parameterClass="Post">
+ UPDATE [Posts] SET
+ [Title] = #Title#,
+ [Content] = #Content#,
+ [Date] = #Date:Date#
+ WHERE
+ ([ID] = #Id#)
+ </update>
+
+ <delete id="Post-Delete" parameterClass="Post">
+ DELETE FROM [Posts]
+ WHERE
+ ([ID] = #Id#)
+ </delete>
+ </statements>
+</sqlMap>
\ No newline at end of file
Added: ibatis/trunk/cs/tutorial2/Files/dao.config
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Files/dao.config?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Files/dao.config (added)
+++ ibatis/trunk/cs/tutorial2/Files/dao.config Tue Jul 4 10:50:55 2006
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<daoConfig
+ xmlns="http://ibatis.apache.org/dataAccess"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <providers resource="providers.config"/>
+
+ <context id="SqlMapDao" default="true">
+
+ <properties resource="appSettings.config"/>
+
+ <!-- Database connection information -->
+ <database>
+ <provider name="OleDb2.0"/>
+ <dataSource name="Blogs" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Blogs.mdb"/>
+ </database>
+
+ <daoSessionHandler id="SqlMap">
+ <property name="resource" value="sqlMap.config"/>
+ </daoSessionHandler>
+
+ <daoFactory>
+ <dao
+ interface="Rels.Blogs.DataAccessObjects.IAuthorDao, Rels.Blogs.DataAccessObjects"
+ implementation="Rels.Blogs.DataAccessObjects.AuthorDao, Rels.Blogs.DataAccessObjects" />
+ <dao
+ interface="Rels.Blogs.DataAccessObjects.IBlogDao, Rels.Blogs.DataAccessObjects"
+ implementation="Rels.Blogs.DataAccessObjects.BlogDao, Rels.Blogs.DataAccessObjects" />
+ <dao
+ interface="Rels.Blogs.DataAccessObjects.IPostDao, Rels.Blogs.DataAccessObjects"
+ implementation="Rels.Blogs.DataAccessObjects.PostDao, Rels.Blogs.DataAccessObjects" />
+ </daoFactory>
+
+ </context>
+</daoConfig>
\ No newline at end of file
Added: ibatis/trunk/cs/tutorial2/Files/properties.config
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Files/properties.config?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Files/properties.config (added)
+++ ibatis/trunk/cs/tutorial2/Files/properties.config Tue Jul 4 10:50:55 2006
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<appSettings>
+ <add key="key" value="value" />
+
+</appSettings>
Added: ibatis/trunk/cs/tutorial2/Files/providers.config
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Files/providers.config?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Files/providers.config (added)
+++ ibatis/trunk/cs/tutorial2/Files/providers.config Tue Jul 4 10:50:55 2006
@@ -0,0 +1,277 @@
+<?xml version="1.0" encoding="utf-8"?>
+<providers
+ xmlns="http://ibatis.apache.org/providers"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <!--
+ This file contain definition of SqlServer for iBatisNet
+ Default is sqlServer2.0
+ -->
+ <clear/>
+ <provider
+ name="sqlServer1.0"
+ description="Microsoft SQL Server 7.0/2000, provider V1.0.3300.0 in framework .NET V1.0"
+ enabled="false"
+ assemblyName="System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" connectionClass="System.Data.SqlClient.SqlConnection"
+ commandClass="System.Data.SqlClient.SqlCommand"
+ parameterClass="System.Data.SqlClient.SqlParameter"
+ parameterDbTypeClass="System.Data.SqlDbType"
+ parameterDbTypeProperty="SqlDbType"
+ dataAdapterClass="System.Data.SqlClient.SqlDataAdapter"
+ commandBuilderClass="System.Data.SqlClient.SqlCommandBuilder"
+ usePositionalParameters="false"
+ useParameterPrefixInSql="true"
+ useParameterPrefixInParameter="true"
+ parameterPrefix="@"/>
+ <provider
+ name="sqlServer1.1"
+ description="Microsoft SQL Server 7.0/2000, provider V1.0.5000.0 in framework .NET V1.1"
+ enabled="true"
+ default="false"
+ assemblyName="System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" connectionClass="System.Data.SqlClient.SqlConnection"
+ commandClass="System.Data.SqlClient.SqlCommand"
+ parameterClass="System.Data.SqlClient.SqlParameter"
+ parameterDbTypeClass="System.Data.SqlDbType"
+ parameterDbTypeProperty="SqlDbType"
+ dataAdapterClass="System.Data.SqlClient.SqlDataAdapter"
+ commandBuilderClass="System.Data.SqlClient.SqlCommandBuilder"
+ usePositionalParameters="false"
+ useParameterPrefixInSql="true"
+ useParameterPrefixInParameter="true"
+ parameterPrefix="@"/>
+ <provider
+ name="sqlServer2.0"
+ description="Microsoft SQL Server 7.0/2000 provider in framework .NET V2"
+ enabled="true"
+ default="true"
+ assemblyName="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" connectionClass="System.Data.SqlClient.SqlConnection"
+ commandClass="System.Data.SqlClient.SqlCommand"
+ parameterClass="System.Data.SqlClient.SqlParameter"
+ parameterDbTypeClass="System.Data.SqlDbType"
+ parameterDbTypeProperty="SqlDbType"
+ dataAdapterClass="System.Data.SqlClient.SqlDataAdapter"
+ commandBuilderClass="System.Data.SqlClient.SqlCommandBuilder"
+ usePositionalParameters = "false"
+ useParameterPrefixInSql = "true"
+ useParameterPrefixInParameter = "true"
+ parameterPrefix="@"
+ />
+ <provider name="OleDb1.1"
+ description="OleDb, provider V1.0.5000.0 in framework .NET V1.1"
+ enabled="true"
+ assemblyName="System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" connectionClass="System.Data.OleDb.OleDbConnection"
+ commandClass="System.Data.OleDb.OleDbCommand"
+ parameterClass="System.Data.OleDb.OleDbParameter"
+ parameterDbTypeClass="System.Data.OleDb.OleDbType"
+ parameterDbTypeProperty="OleDbType"
+ dataAdapterClass="System.Data.OleDb.OleDbDataAdapter"
+ commandBuilderClass="System.Data.OleDb.OleDbCommandBuilder"
+ usePositionalParameters="true"
+ useParameterPrefixInSql="false"
+ useParameterPrefixInParameter="false"
+ parameterPrefix=""/>
+ <provider name="OleDb2.0"
+ description="OleDb Provider in .NET V2"
+ enabled="true"
+ assemblyName="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" connectionClass="System.Data.OleDb.OleDbConnection"
+ commandClass="System.Data.OleDb.OleDbCommand"
+ parameterClass="System.Data.OleDb.OleDbParameter"
+ parameterDbTypeClass="System.Data.OleDb.OleDbType"
+ parameterDbTypeProperty="OleDbType"
+ dataAdapterClass="System.Data.OleDb.OleDbDataAdapter"
+ commandBuilderClass="System.Data.OleDb.OleDbCommandBuilder"
+ usePositionalParameters="true"
+ useParameterPrefixInSql="false"
+ useParameterPrefixInParameter="false"
+ parameterPrefix=""/>
+ <provider
+ name="Odbc1.1"
+ description="Odbc, provider V1.0.5000.0 in framework .NET V1.1"
+ enabled="true"
+ assemblyName="System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" connectionClass="System.Data.Odbc.OdbcConnection"
+ commandClass="System.Data.Odbc.OdbcCommand"
+ parameterClass="System.Data.Odbc.OdbcParameter"
+ parameterDbTypeClass="System.Data.Odbc.OdbcType"
+ parameterDbTypeProperty="OdbcType"
+ dataAdapterClass="System.Data.Odbc.OdbcDataAdapter"
+ commandBuilderClass="System.Data.Odbc.OdbcCommandBuilder"
+ usePositionalParameters="true"
+ useParameterPrefixInSql="false"
+ useParameterPrefixInParameter="false"
+ parameterPrefix="@"/>
+ <provider
+ name="oracle9.2"
+ description="Oracle, Oracle provider V9.2.0.401"
+ enabled="false"
+ assemblyName="Oracle.DataAccess, Version=9.2.0.401, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionClass="Oracle.DataAccess.Client.OracleConnection"
+ commandClass="Oracle.DataAccess.Client.OracleCommand"
+ parameterClass="Oracle.DataAccess.Client.OracleParameter"
+ parameterDbTypeClass="Oracle.DataAccess.Client.OracleDbType"
+ parameterDbTypeProperty="OracleDbType"
+ dataAdapterClass="Oracle.DataAccess.Client.OracleDataAdapter"
+ commandBuilderClass="Oracle.DataAccess.Client.OracleCommandBuilder"
+ usePositionalParameters="false"
+ useParameterPrefixInSql="true"
+ useParameterPrefixInParameter="false"
+ parameterPrefix=":"
+ useDeriveParameters="false"/>
+ <provider
+ name="oracle10.1"
+ description="Oracle, oracle provider V10.1.0.301"
+ enabled="false"
+ assemblyName="Oracle.DataAccess, Version=10.1.0.301, Culture=neutral, PublicKeyToken=89b483f429c47342" connectionClass="Oracle.DataAccess.Client.OracleConnection"
+ commandClass="Oracle.DataAccess.Client.OracleCommand"
+ parameterClass="Oracle.DataAccess.Client.OracleParameter"
+ parameterDbTypeClass="Oracle.DataAccess.Client.OracleDbType"
+ parameterDbTypeProperty="OracleDbType"
+ dataAdapterClass="Oracle.DataAccess.Client.OracleDataAdapter"
+ commandBuilderClass="Oracle.DataAccess.Client.OracleCommandBuilder"
+ usePositionalParameters="true"
+ useParameterPrefixInSql="true"
+ useParameterPrefixInParameter="true"
+ parameterPrefix=":"
+ useDeriveParameters="false"/>
+ <provider
+ name="oracleClient1.0"
+ description="Oracle, Microsoft provider V1.0.5000.0"
+ enabled="false"
+ assemblyName="System.Data.OracleClient, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" connectionClass="System.Data.OracleClient.OracleConnection"
+ commandClass="System.Data.OracleClient.OracleCommand"
+ parameterClass="System.Data.OracleClient.OracleParameter"
+ parameterDbTypeClass="System.Data.OracleClient.OracleType"
+ parameterDbTypeProperty="OracleType"
+ dataAdapterClass="System.Data.OracleClient.OracleDataAdapter"
+ commandBuilderClass="System.Data.OracleClient.OracleCommandBuilder"
+ usePositionalParameters="false"
+ useParameterPrefixInSql="true"
+ useParameterPrefixInParameter="false"
+ parameterPrefix=":"/>
+ <provider
+ name="ByteFx"
+ description="MySQL, ByteFx provider V0.7.6.15073"
+ enabled="false"
+ assemblyName="ByteFX.MySqlClient, Version=0.7.6.15073, Culture=neutral, PublicKeyToken=f2fef6fed1732fc1" connectionClass="ByteFX.Data.MySqlClient.MySqlConnection"
+ commandClass="ByteFX.Data.MySqlClient.MySqlCommand"
+ parameterClass="ByteFX.Data.MySqlClient.MySqlParameter"
+ parameterDbTypeClass="ByteFX.Data.MySqlClient.MySqlDbType"
+ parameterDbTypeProperty="MySqlDbType"
+ dataAdapterClass="ByteFX.Data.MySqlClient.MySqlDataAdapter"
+ commandBuilderClass="ByteFX.Data.MySqlClient.MySqlCommandBuilder"
+ usePositionalParameters="false"
+ useParameterPrefixInSql="true"
+ useParameterPrefixInParameter="true"
+ parameterPrefix="@"/>
+ <provider
+ name="MySql"
+ description="MySQL, MySQL provider V1.0.5.13785"
+ enabled="false"
+ assemblyName="MySql.Data, Version=1.0.5.13785, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionClass="MySql.Data.MySqlClient.MySqlConnection"
+ commandClass="MySql.Data.MySqlClient.MySqlCommand"
+ parameterClass="MySql.Data.MySqlClient.MySqlParameter"
+ parameterDbTypeClass="MySql.Data.MySqlClient.MySqlDbType"
+ parameterDbTypeProperty="MySqlDbType"
+ dataAdapterClass="MySql.Data.MySqlClient.MySqlDataAdapter"
+ commandBuilderClass="MySql.Data.MySqlClient.MySqlCommandBuilder"
+ usePositionalParameters="false"
+ useParameterPrefixInSql="true"
+ useParameterPrefixInParameter="true"
+ parameterPrefix="?"/>
+ <provider
+ name="SQLite3"
+ description="SQLite, SQLite.NET provider V0.21.1869.3794"
+ enabled="false"
+ assemblyName="SQLite.NET, Version=0.21.1869.3794, Culture=neutral, PublicKeyToken=c273bd375e695f9c" connectionClass="Finisar.SQLite.SQLiteConnection"
+ commandClass="Finisar.SQLite.SQLiteCommand"
+ parameterClass="Finisar.SQLite.SQLiteParameter"
+ parameterDbTypeClass="System.Data.DbType, System.Data"
+ parameterDbTypeProperty="DbType"
+ dataAdapterClass="Finisar.SQLite.SQLiteDataAdapter"
+ commandBuilderClass="Finisar.SQLite.SQLiteCommandBuilder"
+ usePositionalParameters="true"
+ useParameterPrefixInSql="false"
+ useParameterPrefixInParameter="false"
+ parameterPrefix=""
+ setDbParameterPrecision="false"
+ setDbParameterScale="false"
+ setDbParameterSize="false"/>
+ <provider
+ name="Firebird1.7"
+ description="Firebird, Firebird SQL .NET provider V1.7.0.33200"
+ enabled="false"
+ assemblyName="FirebirdSql.Data.Firebird, Version=1.7.0.33200, Culture=neutral, PublicKeyToken=fa843d180294369d" connectionClass="FirebirdSql.Data.Firebird.FbConnection"
+ commandClass="FirebirdSql.Data.Firebird.FbCommand"
+ parameterClass="FirebirdSql.Data.Firebird.FbParameter"
+ parameterDbTypeClass="FirebirdSql.Data.Firebird.FbDbType"
+ parameterDbTypeProperty="FbDbType"
+ dataAdapterClass="FirebirdSql.Data.Firebird.FbDataAdapter"
+ commandBuilderClass="FirebirdSql.Data.Firebird.FbCommandBuilder"
+ usePositionalParameters="false"
+ useParameterPrefixInSql="true"
+ useParameterPrefixInParameter="true"
+ parameterPrefix="@"/>
+ <provider
+ name="PostgreSql0.7"
+ description="PostgreSql, Npgsql provider V0.7.0.0"
+ enabled="false"
+ assemblyName="Npgsql, Version=0.7.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7"
+ connectionClass="Npgsql.NpgsqlConnection"
+ commandClass="Npgsql.NpgsqlCommand"
+ parameterClass="Npgsql.NpgsqlParameter"
+ parameterDbTypeClass="NpgsqlTypes.NpgsqlDbType"
+ parameterDbTypeProperty="NpgsqlDbType"
+ dataAdapterClass="Npgsql.NpgsqlDataAdapter"
+ commandBuilderClass="Npgsql.NpgsqlCommandBuilder"
+ usePositionalParameters="false"
+ useParameterPrefixInSql="true"
+ useParameterPrefixInParameter="true"
+ parameterPrefix=":"/>
+ <provider
+ name="PostgreSql0.7.1"
+ description="PostgreSql, Npgsql provider V0.7.1.0"
+ enabled="false"
+ assemblyName="Npgsql, Version=0.7.1.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7"
+ connectionClass="Npgsql.NpgsqlConnection"
+ commandClass="Npgsql.NpgsqlCommand"
+ parameterClass="Npgsql.NpgsqlParameter"
+ parameterDbTypeClass="NpgsqlTypes.NpgsqlDbType"
+ parameterDbTypeProperty="NpgsqlDbType"
+ dataAdapterClass="Npgsql.NpgsqlDataAdapter"
+ commandBuilderClass="Npgsql.NpgsqlCommandBuilder"
+ usePositionalParameters="false"
+ useParameterPrefixInSql="true"
+ useParameterPrefixInParameter="true"
+ parameterPrefix=":"/>
+ <provider
+ name="iDb2.10"
+ description="IBM DB2 Provider, V 10.0"
+ enabled="false"
+ assemblyName="IBM.Data.DB2.iSeries, Version=10.0.0.0,Culture=neutral, PublicKeyToken=9cdb2ebfb1f93a26, Custom=null" connectionClass="IBM.Data.DB2.iSeries.iDB2Connection"
+ commandClass="IBM.Data.DB2.iSeries.iDB2Command"
+ parameterClass="IBM.Data.DB2.iSeries.iDB2Parameter"
+ parameterDbTypeClass="IBM.Data.DB2.iSeries.iDB2DbType"
+ parameterDbTypeProperty="iDB2DbType"
+ dataAdapterClass="IBM.Data.DB2.iSeries.iDB2DataAdapter"
+ commandBuilderClass="IBM.Data.DB2.iSeries.iDB2CommandBuilder"
+ usePositionalParameters="true"
+ useParameterPrefixInSql="false"
+ useParameterPrefixInParameter="false"
+ parameterPrefix=""/>
+ <provider
+ name="Informix"
+ description="Informix NET Provider, 2.81.0.0"
+ enabled="false"
+ assemblyName="IBM.Data.Informix, Version=2.81.0.0, Culture=neutral, PublicKeyToken=7c307b91aa13d208"
+ connectionClass="IBM.Data.Informix.IfxConnection"
+ commandClass="IBM.Data.Informix.IfxCommand"
+ parameterClass="IBM.Data.Informix.IfxParameter"
+ parameterDbTypeClass="IBM.Data.Informix.IfxType"
+ parameterDbTypeProperty="IfxType"
+ dataAdapterClass="IBM.Data.Informix.IfxDataAdapter"
+ commandBuilderClass="IBM.Data.Informix.IfxCommandBuilder"
+ usePositionalParameters = "true"
+ useParameterPrefixInSql = "false"
+ useParameterPrefixInParameter = "false"
+ useDeriveParameters="false"
+ />
+
+</providers>
Added: ibatis/trunk/cs/tutorial2/Files/sqlMap.config
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Files/sqlMap.config?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Files/sqlMap.config (added)
+++ ibatis/trunk/cs/tutorial2/Files/sqlMap.config Tue Jul 4 10:50:55 2006
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<sqlMapConfig
+ xmlns="http://ibatis.apache.org/dataMapper"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <properties resource="../../../Files/properties.config"/>
+
+ <settings>
+ <setting useStatementNamespaces="false"/>
+ </settings>
+
+ <!-- Database connection information -->
+ <database>
+ <provider name="OleDb2.0"/>
+ <dataSource name="Blogs" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=../../../Files/Blogs.mdb"/>
+ </database>
+
+ <sqlMaps>
+ <sqlMap resource="../../../Files/Maps/Access/Post.xml" />
+ <sqlMap resource="../../../Files/Maps/Access/Blog.xml" />
+ <sqlMap resource="../../../Files/Maps/Access/Author.xml" />
+ </sqlMaps>
+
+</sqlMapConfig>
Added: ibatis/trunk/cs/tutorial2/Files/sqlMap_sqlserver.config
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Files/sqlMap_sqlserver.config?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Files/sqlMap_sqlserver.config (added)
+++ ibatis/trunk/cs/tutorial2/Files/sqlMap_sqlserver.config Tue Jul 4 10:50:55 2006
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<sqlMapConfig
+ xmlns="http://ibatis.apache.org/dataMapper"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <properties resource="appSettings.config"/>
+
+ <!-- Database connection information -->
+ <database>
+ <provider name="sqlServer2.0"/>
+ <dataSource name="Blogs" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=Blog;Integrated Security=true;"/>
+ </database>
+
+ <sqlMaps>
+ <sqlMap resource="maps_sqlserver\Author.xml" />
+ <sqlMap resource="maps_sqlserver\Blog.xml" />
+ <sqlMap resource="maps_sqlserver\Post.xml" />
+ </sqlMaps>
+
+</sqlMapConfig>
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Application/BlogPresenter.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Application/BlogPresenter.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Application/BlogPresenter.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Application/BlogPresenter.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,72 @@
+using System.ComponentModel;
+using Tutorial2.Domain;
+using Tutorial2.Service;
+
+namespace Tutorial2.Application
+{
+ public class BlogPresenter
+ {
+ private readonly IBlogService _service = null;
+ private readonly IBlogView _view = null;
+
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="BlogPresenter"/> class.
+ /// </summary>
+ /// <param name="view">The view.</param>
+ /// <param name="service">The service.</param>
+ /// <remarks>
+ /// Use "Dependency Injection" to attach the dependencies for the view and service.
+ /// </remarks>
+ public BlogPresenter(IBlogView view, IBlogService service)
+ {
+ _view = view;
+ _service = service;
+ }
+
+ /// <summary>
+ /// Check for User.
+ /// </summary>
+ /// <param name="login">The login.</param>
+ /// <param name="password">The password.</param>
+ public void Verify(string login, string password)
+ {
+ _view.Author = _service.Verify(login, password);
+ }
+
+
+
+ /// <summary>
+ /// Creates the blog.
+ /// </summary>
+ /// <param name="name">The name.</param>
+ /// <param name="description">The description.</param>
+ public void CreateBlog(string name, string description)
+ {
+ Blog blog = new Blog();
+ blog.Name = name;
+ blog.Description = description;
+
+ _service.SaveBlog(blog);
+
+ _view.Blog = blog;
+ }
+
+ /// <summary>
+ /// Creates the post.
+ /// </summary>
+ /// <param name="title">The title.</param>
+ /// <param name="text">The text.</param>
+ public void CreatePost(string title, string text)
+ {
+ Post post = new Post();
+ post.Title = title;
+ post.Content = text;
+ post.Blog = _view.Blog;
+
+ _service.SavePost(post);
+
+ _view.Blog.Posts.Add(post);
+ }
+ }
+}
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Application/BlogPresenter.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Application/BlogPresenter.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Application/IBlogView.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Application/IBlogView.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Application/IBlogView.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Application/IBlogView.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Text;
+using Tutorial2.Domain;
+
+namespace Tutorial2.Application
+{
+ public interface IBlogView
+ {
+ Author Author { set; get;}
+
+ Blog Blog { set; get;}
+
+ BindingList<Post> Posts { set; get;}
+
+ }
+}
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Application/IBlogView.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Application/IBlogView.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Application/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Application/Properties/AssemblyInfo.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Application/Properties/AssemblyInfo.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Application/Properties/AssemblyInfo.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Tutorial2.Application")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("NoName.Org")]
+[assembly: AssemblyProduct("Tutorial2.Application")]
+[assembly: AssemblyCopyright("Copyright © NoName.Org 2006")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("76dfe974-7748-4bbf-8460-da19486e098e")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Application/Properties/AssemblyInfo.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Application/Properties/AssemblyInfo.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Application/Tutorial2.Application.csproj
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Application/Tutorial2.Application.csproj?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Application/Tutorial2.Application.csproj (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Application/Tutorial2.Application.csproj Tue Jul 4 10:50:55 2006
@@ -0,0 +1,58 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{063AA034-BD5A-4792-8539-C0A066D7E4FD}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Tutorial2.Application</RootNamespace>
+ <AssemblyName>Tutorial2.Application</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="BlogPresenter.cs" />
+ <Compile Include="IBlogView.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Tutorial2.Domain\Tutorial2.Domain.csproj">
+ <Project>{8F74B099-C14F-4DE8-8F3F-30846C931EA8}</Project>
+ <Name>Tutorial2.Domain</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Tutorial2.Service\Tutorial2.Service.csproj">
+ <Project>{767A1F9F-FBF4-4F73-A8F1-9531DC69C320}</Project>
+ <Name>Tutorial2.Service</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Author.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Author.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Author.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Author.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,43 @@
+namespace Tutorial2.Domain
+{
+ public class Author : EntityBase
+ {
+ private string _name = string.Empty;
+ private string _login = string.Empty;
+ private string _password = string.Empty;
+ private Blog _blog = null;
+
+ public Author()
+ {
+ }
+
+ public Author(string name)
+ {
+ _name = name;
+ }
+
+ public string Name
+ {
+ get { return _name; }
+ set { _name = value; }
+ }
+
+ public Blog Blog
+ {
+ get { return _blog; }
+ set { _blog = value; }
+ }
+
+ public string Login
+ {
+ get { return _login; }
+ set { _login = value; }
+ }
+
+ public string Password
+ {
+ get { return _password; }
+ set { _password = value; }
+ }
+ }
+}
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Author.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Author.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Blog.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Blog.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Blog.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Blog.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+
+namespace Tutorial2.Domain
+{
+ public class Blog : EntityBase
+ {
+ private string _name = string.Empty;
+ protected string _description = string.Empty;
+ private Author _author = null;
+ private IList<Post> _posts = new List<Post>();
+
+ public string Name
+ {
+ get { return _name; }
+ set { _name = value; }
+ }
+
+ public string Description
+ {
+ get { return _description; }
+ set { _description = value; }
+ }
+
+ public Author Author
+ {
+ get { return _author; }
+ set { _author = value; }
+ }
+
+ public IList<Post> Posts
+ {
+ get { return _posts; }
+ set { _posts = value; }
+ }
+ }
+}
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Blog.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Blog.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Comment.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Comment.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Comment.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Comment.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,13 @@
+namespace Tutorial2.Domain
+{
+ public class Comment : EntityBase
+ {
+ private string _text = string.Empty;
+
+ public string Text
+ {
+ get { return _text; }
+ set { _text = value; }
+ }
+ }
+}
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Comment.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Comment.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/DomainDiagram.cd
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Domain/DomainDiagram.cd?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Domain/DomainDiagram.cd (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Domain/DomainDiagram.cd Tue Jul 4 10:50:55 2006
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ClassDiagram MajorVersion="1" MinorVersion="1">
+ <Font Name="Tahoma" Size="8.25" />
+ <Class Name="Tutorial2.Domain.EntityBase">
+ <Position X="5.75" Y="0.75" Width="1.5" />
+ <TypeIdentifier>
+ <FileName>EntityBase.cs</FileName>
+ <HashCode>AAACAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
+ </TypeIdentifier>
+ <Compartments>
+ <Compartment Name="Fields" Collapsed="true" />
+ </Compartments>
+ </Class>
+ <Class Name="Tutorial2.Domain.Blog">
+ <Position X="5.75" Y="3" Width="1.5" />
+ <TypeIdentifier>
+ <FileName>Blog.cs</FileName>
+ <HashCode>AAABIAAAAAAgAAQEBAAAAAQAAAAAAIAAAAAAAAAAAAA=</HashCode>
+ </TypeIdentifier>
+ <ShowAsAssociation>
+ <Property Name="User" />
+ </ShowAsAssociation>
+ <ShowAsCollectionAssociation>
+ <Property Name="Posts" />
+ </ShowAsCollectionAssociation>
+ <Compartments>
+ <Compartment Name="Fields" Collapsed="true" />
+ </Compartments>
+ </Class>
+ <Class Name="Tutorial2.Domain.Post">
+ <Position X="8.25" Y="3" Width="1.5" />
+ <TypeIdentifier>
+ <FileName>Post.cs</FileName>
+ <HashCode>AAAIAAAAEoAAAEABBAAAAAAAAAAAAAABAAAAAAAIIAA=</HashCode>
+ </TypeIdentifier>
+ <ShowAsAssociation>
+ <Property Name="Blog" />
+ </ShowAsAssociation>
+ <Compartments>
+ <Compartment Name="Fields" Collapsed="true" />
+ </Compartments>
+ </Class>
+ <Class Name="Tutorial2.Domain.User">
+ <Position X="3.25" Y="3" Width="1.5" />
+ <TypeIdentifier>
+ <FileName>User.cs</FileName>
+ <HashCode>AAQAIAAAAAAAAAAAAAAAAAQAAEAAAAACAAAQIAAIAAA=</HashCode>
+ </TypeIdentifier>
+ <ShowAsCollectionAssociation>
+ <Property Name="Blogs" />
+ </ShowAsCollectionAssociation>
+ <Compartments>
+ <Compartment Name="Fields" Collapsed="true" />
+ </Compartments>
+ </Class>
+</ClassDiagram>
\ No newline at end of file
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/EntityBase.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Domain/EntityBase.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Domain/EntityBase.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Domain/EntityBase.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,12 @@
+namespace Tutorial2.Domain
+{
+ public abstract class EntityBase
+ {
+ protected System.Nullable<int> _id = null;
+
+ public System.Nullable<int> Id
+ {
+ get { return _id; }
+ }
+ }
+}
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/EntityBase.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/EntityBase.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Post.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Post.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Post.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Post.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+
+namespace Tutorial2.Domain
+{
+ public class Post : EntityBase
+ {
+ private IList<Comment> _comments = new List<Comment>();
+ private string _title = string.Empty;
+ private string _content = string.Empty;
+ private Blog _blog = null;
+ private DateTime _date = DateTime.Now;
+
+ public IList<Comment> Comments
+ {
+ get { return _comments; }
+ set { _comments = value; }
+ }
+
+ public string Title
+ {
+ get { return _title; }
+ set { _title = value; }
+ }
+
+ public string Content
+ {
+ get { return _content; }
+ set { _content = value; }
+ }
+
+ public Blog Blog
+ {
+ get { return _blog; }
+ set { _blog = value; }
+ }
+
+ public DateTime Date
+ {
+ get { return _date; }
+ set { _date = value; }
+ }
+ }
+}
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Post.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Post.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Properties/AssemblyInfo.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Properties/AssemblyInfo.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Properties/AssemblyInfo.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Tutorial2.Domain")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("NoName.Org")]
+[assembly: AssemblyProduct("Tutorial2.Domain")]
+[assembly: AssemblyCopyright("Copyright © NoName.Org 2006")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("a5f7d6cd-8452-4dae-8e3b-46810ddd51c9")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Properties/AssemblyInfo.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Properties/AssemblyInfo.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Tutorial2.Domain.csproj
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Tutorial2.Domain.csproj?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Tutorial2.Domain.csproj (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Domain/Tutorial2.Domain.csproj Tue Jul 4 10:50:55 2006
@@ -0,0 +1,54 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{8F74B099-C14F-4DE8-8F3F-30846C931EA8}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Tutorial2.Domain</RootNamespace>
+ <AssemblyName>Tutorial2.Domain</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Blog.cs" />
+ <Compile Include="Comment.cs" />
+ <Compile Include="EntityBase.cs" />
+ <Compile Include="Post.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Author.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="DomainDiagram.cd" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Service/BlogService.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Service/BlogService.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Service/BlogService.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Service/BlogService.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,58 @@
+using System;
+using System.Collections;
+using IBatisNet.DataMapper;
+using Tutorial2.Domain;
+
+namespace Tutorial2.Service
+{
+ public class BlogService : IBlogService
+ {
+ private ISqlMapper _mapper = null;
+
+
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="BlogService"/> class.
+ /// </summary>
+ /// <param name="mapper">The mapper.</param>
+ public BlogService(ISqlMapper mapper)
+ {
+ _mapper = mapper;
+ }
+
+ #region IBlogService Members
+
+ /// <summary>
+ /// Check for Author.
+ /// </summary>
+ /// <param name="login">The login.</param>
+ /// <param name="password">The password.</param>
+ /// <returns></returns>
+ public Author Verify(string login, string password)
+ {
+ Hashtable map = new Hashtable();
+ map.Add("Login", login);
+ map.Add("Password", password);
+
+ return _mapper.QueryForObject<Author>("Author-Verify", map); ;
+ }
+
+ /// <summary>
+ /// Saves the blog.
+ /// </summary>
+ /// <param name="blog">The blog.</param>
+ public void SaveBlog(Blog blog)
+ {
+ }
+
+ /// <summary>
+ /// Saves the post.
+ /// </summary>
+ /// <param name="post">The post.</param>
+ public void SavePost(Post post)
+ {
+ _mapper.Insert("Post-Insert", post);
+ }
+ #endregion
+ }
+}
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Service/BlogService.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Service/BlogService.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Service/IBlogService.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Service/IBlogService.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Service/IBlogService.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Service/IBlogService.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,28 @@
+using Tutorial2.Domain;
+
+namespace Tutorial2.Service
+{
+ public interface IBlogService
+ {
+
+ /// <summary>
+ /// Check for Author.
+ /// </summary>
+ /// <param name="login">The login.</param>
+ /// <param name="password">The password.</param>
+ /// <returns></returns>
+ Author Verify(string login, string password);
+
+ /// <summary>
+ /// Saves the blog.
+ /// </summary>
+ /// <param name="blog">The blog.</param>
+ void SaveBlog(Blog blog);
+
+ /// <summary>
+ /// Saves the post.
+ /// </summary>
+ /// <param name="post">The post.</param>
+ void SavePost(Post post);
+ }
+}
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Service/IBlogService.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Service/IBlogService.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Service/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Service/Properties/AssemblyInfo.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Service/Properties/AssemblyInfo.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Service/Properties/AssemblyInfo.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Tutorial2.Service")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("NoName.Org")]
+[assembly: AssemblyProduct("Tutorial2.Service")]
+[assembly: AssemblyCopyright("Copyright © NoName.Org 2006")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("b436368b-9666-405c-9e65-eff946663908")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Service/Properties/AssemblyInfo.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Service/Properties/AssemblyInfo.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Service/Tutorial2.Service.csproj
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Service/Tutorial2.Service.csproj?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Service/Tutorial2.Service.csproj (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Service/Tutorial2.Service.csproj Tue Jul 4 10:50:55 2006
@@ -0,0 +1,58 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{767A1F9F-FBF4-4F73-A8F1-9531DC69C320}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Tutorial2.Service</RootNamespace>
+ <AssemblyName>Tutorial2.Service</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="IBatisNet.DataMapper, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\External-bin\IBatisNet.DataMapper.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="BlogService.cs" />
+ <Compile Include="IBlogService.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Tutorial2.Domain\Tutorial2.Domain.csproj">
+ <Project>{8F74B099-C14F-4DE8-8F3F-30846C931EA8}</Project>
+ <Name>Tutorial2.Domain</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Test/App.config
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Test/App.config?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Test/App.config (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Test/App.config Tue Jul 4 10:50:55 2006
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <configSections>
+ <sectionGroup name="iBATIS">
+ <section name="logging" type="IBatisNet.Common.Logging.ConfigurationSectionHandler, IBatisNet.Common" />
+ </sectionGroup>
+ </configSections>
+
+ <iBATIS>
+ <logging>
+ <logFactoryAdapter type="IBatisNet.Common.Logging.Impl.ConsoleOutLoggerFA, IBatisNet.Common">
+ <arg key="showLogName" value="true" />
+ <arg key="showDataTime" value="true" />
+ <arg key="level" value="ALL" />
+ <arg key="dateTimeFormat" value="yyyy/MM/dd HH:mm:ss:SSS" />
+ </logFactoryAdapter>
+ <!--
+ <logFactoryAdapter type="IBatisNet.Common.Logging.Impl.Log4NetLoggerFA, IBatisNet.Common.Logging.Log4Net">
+ <arg key="configType" value="inline" />
+ </logFactoryAdapter>
+-->
+<!--
+ <logFactoryAdapter type="IBatisNet.Common.Logging.Impl.NoOpLoggerFA, IBatisNet.Common" />
+-->
+ </logging>
+ </iBATIS>
+</configuration>
\ No newline at end of file
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Test/ManualMock/BlogServiceMock.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Test/ManualMock/BlogServiceMock.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Test/ManualMock/BlogServiceMock.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Test/ManualMock/BlogServiceMock.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,55 @@
+using Tutorial2.Domain;
+using Tutorial2.Service;
+
+namespace Tutorial2.Test
+{
+ public class BlogServiceMock : IBlogService
+ {
+ #region IBlogService Members
+
+ /// <summary>
+ /// Check for Author.
+ /// </summary>
+ /// <param name="login">The login.</param>
+ /// <param name="password">The password.</param>
+ /// <returns></returns>
+ public Author Verify(string login, string password)
+ {
+ Author author = new Author("Gilles");
+ author.Login = "ibatis";
+ author.Password = "rock";
+
+ Blog blog = new Blog();
+ blog.Name = "iBATIS Blog";
+
+ Post post = new Post();
+ post.Title = "iBATSI Drives MySpace :-)";
+ post.Content = "...";
+
+ blog.Posts.Add(post);
+
+ author.Blog = blog;
+
+ return author;
+ }
+
+ /// <summary>
+ /// Saves the blog.
+ /// </summary>
+ /// <param name="blog">The blog.</param>
+ public void SaveBlog(Blog blog)
+ {
+ }
+
+ /// <summary>
+ /// Saves the post.
+ /// </summary>
+ /// <param name="post">The post.</param>
+ public void SavePost(Post post)
+ {
+
+ }
+
+ #endregion
+ }
+}
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Test/ManualMock/BlogServiceMock.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Test/ManualMock/BlogServiceMock.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Test/ManualMock/BlogViewMock.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Test/ManualMock/BlogViewMock.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Test/ManualMock/BlogViewMock.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Test/ManualMock/BlogViewMock.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,35 @@
+using System.ComponentModel;
+using Tutorial2.Application;
+using Tutorial2.Domain;
+
+namespace Tutorial2.Test
+{
+ public class BlogViewMock : IBlogView
+ {
+ private Author _author = null;
+ private Blog _blog= null;
+ private BindingList<Post> _posts = new BindingList<Post>();
+
+ #region IBlogView Members
+
+ public Author Author
+ {
+ get { return _author; }
+ set { _author = value; }
+ }
+
+ public Blog Blog
+ {
+ get { return _blog; }
+ set { _blog = value; }
+ }
+
+ public BindingList<Post> Posts
+ {
+ get { return _posts; }
+ set { _posts = value; }
+ }
+
+ #endregion
+ }
+}
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Test/ManualMock/BlogViewMock.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Test/ManualMock/BlogViewMock.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Test/ManualMock/DaoManagerMock.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Test/ManualMock/DaoManagerMock.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Test/ManualMock/DaoManagerMock.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Test/ManualMock/DaoManagerMock.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,81 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using IBatisNet.Common;
+using IBatisNet.DataAccess;
+using IBatisNet.DataAccess.Interfaces;
+
+namespace Tutorial2.Test
+{
+ public class DaoManagerMock : IDaoManager
+ {
+ #region IDaoManager Members
+
+ public IDalSession BeginTransaction()
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ public IDalSession BeginTransaction(System.Data.IsolationLevel isolationLevel)
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ public void CloseConnection()
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ public void CommitTransaction()
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ public IBatisNet.DataAccess.Interfaces.IDao GetDao(Type daoInterface)
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ public DaoSession GetDaoSession()
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ public bool IsDaoSessionStarted()
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ public IDalSession LocalDaoSession
+ {
+ get { throw new Exception("The method or operation is not implemented."); }
+ }
+
+ public DataSource LocalDataSource
+ {
+ get { throw new Exception("The method or operation is not implemented."); }
+ }
+
+ public IDalSession OpenConnection()
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ public IDalSession OpenConnection(string connectionString)
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ public void RollBackTransaction()
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ public IDao this[Type daoInterface]
+ {
+ get { throw new Exception("The method or operation is not implemented."); }
+ }
+
+ #endregion
+ }
+}
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Test/ManualMock/DaoManagerMock.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Test/ManualMock/DaoManagerMock.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Test/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Test/Properties/AssemblyInfo.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Test/Properties/AssemblyInfo.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Test/Properties/AssemblyInfo.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Tutorial2.Test")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("NoName.Org")]
+[assembly: AssemblyProduct("Tutorial2.Test")]
+[assembly: AssemblyCopyright("Copyright © NoName.Org 2006")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("37885e4b-280e-46b7-96fe-c22ba954d293")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Test/Properties/AssemblyInfo.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Test/Properties/AssemblyInfo.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Test/TestBlogService.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Test/TestBlogService.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Test/TestBlogService.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Test/TestBlogService.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,36 @@
+using IBatisNet.DataMapper;
+using IBatisNet.DataMapper.Configuration;
+using NUnit.Framework;
+using Tutorial2.Domain;
+using Tutorial2.Service;
+
+namespace Tutorial2.Test
+{
+ [TestFixture]
+ public class TestBlogService
+ {
+ private IBlogService blogService = null;
+ [SetUp]
+ public void SetUp()
+ {
+ DomSqlMapBuilder builder = new DomSqlMapBuilder();
+ ISqlMapper mapper = builder.Configure(@"../../../Files/sqlMap.config");
+
+ blogService = new BlogService(mapper);
+ }
+
+ [Test]
+ public void SelectVerify()
+ {
+ Author gilles = blogService.Verify("gilles","test");
+
+ Assert.IsNotNull(gilles,"gilles is null !");
+ Assert.IsTrue(gilles.Login == "gilles");
+ Assert.IsNotNull(gilles.Blog, "Gilles blog is null");
+ Assert.IsTrue(gilles.Blog.Name == "Gilles Weblog", "Gilles blog is not 'Gilles Weblog' ");
+
+ Assert.IsTrue(gilles.Blog.Posts.Count > 0);
+
+ }
+ }
+}
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Test/TestBlogService.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Test/TestBlogService.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Test/TestDataMapper.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Test/TestDataMapper.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Test/TestDataMapper.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Test/TestDataMapper.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,81 @@
+using IBatisNet.DataMapper.Configuration;
+using NUnit.Framework;
+using IBatisNet.DataMapper;
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Tutorial2.Domain;
+
+namespace Tutorial2.Test
+{
+ [TestFixture]
+ public class TestDataMapper
+ {
+ private ISqlMapper mapper = null;
+ private Author gilles = null;
+
+ [SetUp]
+ public void SetUp()
+ {
+ DomSqlMapBuilder builder = new DomSqlMapBuilder();
+ mapper = builder.Configure(@"../../../Files/sqlMap.config");
+ }
+
+ [Test]
+ public void SelectBasicAuthor()
+ {
+ gilles = mapper.QueryForObject<Author>("Author-Select-Basic", 2);
+ Assert.IsTrue(gilles.Login=="gilles");
+ }
+
+ /// <summary>
+ /// Shows lazy loading + resultMap usage on a result property
+ /// </summary>
+ [Test]
+ public void SelectAuthorAndBlogAndLazyPost()
+ {
+ gilles = mapper.QueryForObject<Author>("Author-Select", 2);
+
+ Assert.IsTrue(gilles.Login == "gilles");
+ Assert.IsNotNull(gilles.Blog, "Gilles blog is null");
+ Assert.IsTrue(gilles.Blog.Name == "Gilles Weblog", "Gilles blog is not 'Gilles Weblog' ");
+
+ Assert.IsTrue(gilles.Blog.Posts.Count > 0);
+ }
+
+ [Test]
+ public void InsertAuthor()
+ {
+ Author author = new Author();
+ author.Name = "test" + DateTime.Now.ToShortDateString();
+ author.Login = "Login";
+ author.Password = "Password";
+
+ Assert.IsNull(author.Id);
+ mapper.Insert("Author-Insert", author);
+ Assert.IsNotNull(author.Id);
+
+ mapper.Delete("Author-Delete", author.Id);
+ }
+
+ [Test]
+ public void UpdateAuthor()
+ {
+ gilles = mapper.QueryForObject<Author>("Author-Select-Basic", 2);
+ string newPassword= DateTime.Now.ToShortDateString();
+ gilles.Password = newPassword;
+
+ mapper.Update("Author-Update", gilles);
+ gilles = mapper.QueryForObject<Author>("Author-Select-Basic", 2);
+
+ Assert.IsTrue(gilles.Password == newPassword);
+
+ gilles.Password = "test";
+
+ mapper.Update("Author-Update", gilles);
+
+ }
+
+ }
+}
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Test/TestDataMapper.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Test/TestDataMapper.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Test/TestManualPresenterMock.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Test/TestManualPresenterMock.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Test/TestManualPresenterMock.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Test/TestManualPresenterMock.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,47 @@
+using NUnit.Framework;
+using Tutorial2.Application;
+using Tutorial2.Domain;
+using Tutorial2.Service;
+
+namespace Tutorial2.Test
+{
+ [TestFixture]
+ public class TestManualPresenterMock
+ {
+ protected IBlogService service = null;
+ protected BlogPresenter presenter = null;
+ protected IBlogView view = null;
+
+ [SetUp]
+ public void SetUp()
+ {
+ view = new BlogViewMock();
+ service = new BlogServiceMock();
+ presenter = new BlogPresenter(view, service);
+ }
+
+ [Test]
+ public void Verify()
+ {
+ presenter.Verify("ibatis","rock") ;
+
+ Assert.IsTrue(view.Author.Name == "Gilles");
+ }
+
+
+ [Test]
+ public void CreatePost()
+ {
+ view.Author = new Author("Gilles");
+ Blog blog = new Blog();
+ blog.Name = "iBATIS Rock";
+ blog.Posts.Add(new Post());
+ view.Author.Blog = blog;
+ view.Blog = blog;
+
+ presenter.CreatePost("MySpace - Powered by iBATIS", "MySpace.com is now running iBATIS for a good portion of its data access abstraction layer.");
+
+ Assert.IsTrue(view.Blog.Posts.Count == 2);
+ }
+ }
+}
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Test/TestManualPresenterMock.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.Test/TestManualPresenterMock.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Added: ibatis/trunk/cs/tutorial2/Tutorial2.Test/Tutorial2.Test.csproj
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.Test/Tutorial2.Test.csproj?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.Test/Tutorial2.Test.csproj (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.Test/Tutorial2.Test.csproj Tue Jul 4 10:50:55 2006
@@ -0,0 +1,75 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{13A64291-3A95-4D23-8579-AFB2091012D1}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Tutorial2.Test</RootNamespace>
+ <AssemblyName>Tutorial2.Test</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="IBatisNet.DataMapper, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\External-bin\IBatisNet.DataMapper.dll</HintPath>
+ </Reference>
+ <Reference Include="nunit.framework, Version=2.2.6.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL" />
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="ManualMock\BlogServiceMock.cs" />
+ <Compile Include="ManualMock\BlogViewMock.cs" />
+ <Compile Include="TestBlogService.cs" />
+ <Compile Include="TestDataMapper.cs" />
+ <Compile Include="TestManualPresenterMock.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Tutorial2.Application\Tutorial2.Application.csproj">
+ <Project>{063AA034-BD5A-4792-8539-C0A066D7E4FD}</Project>
+ <Name>Tutorial2.Application</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Tutorial2.Domain\Tutorial2.Domain.csproj">
+ <Project>{8F74B099-C14F-4DE8-8F3F-30846C931EA8}</Project>
+ <Name>Tutorial2.Domain</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Tutorial2.Service\Tutorial2.Service.csproj">
+ <Project>{767A1F9F-FBF4-4F73-A8F1-9531DC69C320}</Project>
+ <Name>Tutorial2.Service</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="App.config" />
+ <None Include="bin\Debug\providers.config" />
+ <None Include="bin\Debug\sqlMap.config" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
Added: ibatis/trunk/cs/tutorial2/Tutorial2.WinUI/Login.Designer.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/tutorial2/Tutorial2.WinUI/Login.Designer.cs?rev=419056&view=auto
==============================================================================
--- ibatis/trunk/cs/tutorial2/Tutorial2.WinUI/Login.Designer.cs (added)
+++ ibatis/trunk/cs/tutorial2/Tutorial2.WinUI/Login.Designer.cs Tue Jul 4 10:50:55 2006
@@ -0,0 +1,118 @@
+namespace Tutorial2.WinUI
+{
+ partial class Login
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.textBoxLogin = new System.Windows.Forms.TextBox();
+ this.bindingSourceUser = new System.Windows.Forms.BindingSource(this.components);
+ this.textBoxPassword = new System.Windows.Forms.TextBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.buttonLogin = new System.Windows.Forms.Button();
+ ((System.ComponentModel.ISupportInitialize)(this.bindingSourceUser)).BeginInit();
+ this.SuspendLayout();
+ //
+ // textBoxLogin
+ //
+ this.textBoxLogin.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bindingSourceUser, "Login", true));
+ this.textBoxLogin.Location = new System.Drawing.Point(161, 24);
+ this.textBoxLogin.Name = "textBoxLogin";
+ this.textBoxLogin.Size = new System.Drawing.Size(100, 20);
+ this.textBoxLogin.TabIndex = 0;
+ //
+ // bindingSourceUser
+ //
+ this.bindingSourceUser.DataSource = typeof(Tutorial2.Domain.User);
+ //
+ // textBoxPassword
+ //
+ this.textBoxPassword.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bindingSourceUser, "Password", true));
+ this.textBoxPassword.Location = new System.Drawing.Point(161, 50);
+ this.textBoxPassword.Name = "textBoxPassword";
+ this.textBoxPassword.Size = new System.Drawing.Size(100, 20);
+ this.textBoxPassword.TabIndex = 1;
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(24, 30);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(33, 13);
+ this.label1.TabIndex = 2;
+ this.label1.Text = "Login";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(24, 53);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(53, 13);
+ this.label2.TabIndex = 3;
+ this.label2.Text = "Password";
+ //
+ // buttonLogin
+ //
+ this.buttonLogin.Location = new System.Drawing.Point(186, 91);
+ this.buttonLogin.Name = "buttonLogin";
+ this.buttonLogin.Size = new System.Drawing.Size(75, 23);
+ this.buttonLogin.TabIndex = 4;
+ this.buttonLogin.Text = "Login";
+ this.buttonLogin.UseVisualStyleBackColor = true;
+ this.buttonLogin.Click += new System.EventHandler(this.buttonLogin_Click);
+ //
+ // Login
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(292, 273);
+ this.Controls.Add(this.buttonLogin);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.textBoxPassword);
+ this.Controls.Add(this.textBoxLogin);
+ this.Name = "Login";
+ this.Text = "Tutorial2";
+ this.Load += new System.EventHandler(this.Login_Load);
+ ((System.ComponentModel.ISupportInitialize)(this.bindingSourceUser)).EndInit();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TextBox textBoxLogin;
+ private System.Windows.Forms.TextBox textBoxPassword;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Button buttonLogin;
+ private System.Windows.Forms.BindingSource bindingSourceUser;
+ }
+}
+
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.WinUI/Login.Designer.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: ibatis/trunk/cs/tutorial2/Tutorial2.WinUI/Login.Designer.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy