You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ibatis.apache.org by ro...@apache.org on 2005/03/02 07:15:25 UTC
svn commit: r155890 [1/3] - in incubator/ibatis/trunk/cs/mapper: ./
IBatisNet.Common.Test/ IBatisNet.Common.Test/Maps/Access/OleDb/
IBatisNet.Common.Test/Scripts/Access/ IBatisNet.Common.Test/bin/Debug/
IBatisNet.Common/ IBatisNet.Common/Utilities/ IBatisNet.DataAccess.Test/
IBatisNet.DataAccess.Test/Maps/Access/OleDb/
IBatisNet.DataAccess.Test/Scripts/Access/
IBatisNet.DataAccess.Test/bin/Debug/ IBatisNet.DataMapper.Test/
IBatisNet.DataMapper.Test/Maps/Access/OleDb/
IBatisNet.DataMapper.Test/Scripts/Access/
IBatisNet.DataMapper.Test/bin/Debug/
Author: roberto
Date: Tue Mar 1 22:15:12 2005
New Revision: 155890
URL: http://svn.apache.org/viewcvs?view=rev&rev=155890
Log:
+ Adding Access Tests (SqlMaps, config files, SQL scripts, .mdb files)
~ Modified project files to include new Access files
~ Modified ScriptRunner.cs for tests (refactor to strategy later?)
. Still need to update MySQL and Oracle SqlMap tests for new NUnit tests found in MSSQL SqlMap tests
Added:
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/DataBase.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/DataBaseNHibernate.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/account-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/account-procedure.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/category-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/category-procedure.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/documents-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/enumeration-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/line-item-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/more-account-records.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/order-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/other-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/swap-procedure.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/user-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/bin/Debug/SqlMap_Access_OleDb.config
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/bin/Debug/dao_Access_OleDb.config
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Document.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Other.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/ResultClass.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Scripts/Access/
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Scripts/Access/DataBase.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Scripts/Access/DataBaseNHibernate.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Scripts/Access/account-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Scripts/Access/account-procedure.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Scripts/Access/category-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Scripts/Access/category-procedure.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Scripts/Access/documents-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Scripts/Access/enumeration-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Scripts/Access/line-item-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Scripts/Access/more-account-records.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Scripts/Access/order-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Scripts/Access/other-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Scripts/Access/swap-procedure.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Scripts/Access/user-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/bin/Debug/SqlMap_Access_OleDb.config
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/bin/Debug/dao_Access_OleDb.config
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/Document.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/Other.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/ResultClass.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Access/
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Access/DataBase.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Access/DataBaseNHibernate.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Access/account-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Access/account-procedure.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Access/category-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Access/category-procedure.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Access/documents-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Access/enumeration-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Access/line-item-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Access/more-account-records.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Access/order-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Access/other-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Access/swap-procedure.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Access/user-init.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/SqlMap_Access_OleDb.config
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/dao_Access_OleDb.config
incubator/ibatis/trunk/cs/mapper/IBatisNet.mdb (with props)
incubator/ibatis/trunk/cs/mapper/NHibernate.mdb (with props)
Modified:
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/IBatisNet.Common.Test.csproj
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Maps/Access/OleDb/Account.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common/IBatisNet.Common.csproj
incubator/ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/ScriptRunner.cs
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/IBatisNet.DataAccess.Test.csproj
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Account.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Category.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Complex.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/DynamicAccount.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Enumeration.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/LineItem.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Order.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.csproj
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/Account.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/Category.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/Complex.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/DynamicAccount.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/Enumeration.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/LineItem.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/Order.xml
Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/IBatisNet.Common.Test.csproj
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/IBatisNet.Common.Test.csproj?view=diff&r1=155889&r2=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/IBatisNet.Common.Test.csproj (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/IBatisNet.Common.Test.csproj Tue Mar 1 22:15:12 2005
@@ -135,6 +135,10 @@
BuildAction = "Content"
/>
<File
+ RelPath = "bin\Debug\dao_Access_OleDb.config"
+ BuildAction = "None"
+ />
+ <File
RelPath = "bin\Debug\dao_MSSQL_Odbc.config"
BuildAction = "None"
/>
@@ -167,6 +171,10 @@
BuildAction = "None"
/>
<File
+ RelPath = "bin\Debug\SqlMap_Access_OleDb.config"
+ BuildAction = "None"
+ />
+ <File
RelPath = "bin\Debug\SqlMap_MSSQL_Odbc.config"
BuildAction = "None"
/>
@@ -276,6 +284,62 @@
RelPath = "NUnit\CommonTests\Utilities\ResourcesTest.cs"
SubType = "Code"
BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Scripts\Access\account-init.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\account-procedure.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\category-init.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\category-procedure.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\DataBase.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\DataBaseNHibernate.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\documents-init.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\enumeration-init.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\line-item-init.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\more-account-records.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\order-init.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\other-init.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\swap-procedure.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\user-init.sql"
+ BuildAction = "Content"
/>
<File
RelPath = "Scripts\MSSQL\account-init.sql"
Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Maps/Access/OleDb/Account.xml
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Maps/Access/OleDb/Account.xml?view=diff&r1=155889&r2=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Maps/Access/OleDb/Account.xml (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Maps/Access/OleDb/Account.xml Tue Mar 1 22:15:12 2005
@@ -1,56 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<sqlMap name="Account" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="..\..\Nausicaa.Framework.Dal\Schemas\SqlMap.xsd">
-
- <alias>
- <typeAlias name="Account" assembly="IBatisNet.Test.dll" class="IBatisNet.Test.Domain.Account" />
- </alias>
-
- <!-- =============================================
- <resultMap
- name="name"
- class="name"
- extend="resultMap"
- >
- <result
- property="name"
- column="name"
- columnIndex="name"
- nullValue="value"
- select="name"
- resultMap="name"
- lazyLoad="true/false"
- dbType=""
- />
- <procedure
- name="name"
- parameterMap="name"
- >
- <statement
- name="name"
- parameterClass="name"
- parameterMap="name"
- resultClass="name"
- resultMap="name"
- listClass="name"
- >
- <parameterMap
- name="name"
- class=""
- >
- <parameter
- property="name"
- dbType=""
- output="true/false"
- type=""
- nullValue=""
- />
-
- ============================================= -->
-
+<sqlMap namespace="Account" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="SqlMap.xsd">
+
<cacheModels>
- <cacheModel name="account-cache" implementation="MEMORY" >
+ <cacheModel id="account-cache" implementation="MEMORY" >
<flushInterval hours="24"/>
<flushOnExecute statement="UpdateAccountViaInlineParameters"/>
<flushOnExecute statement="UpdateAccountViaParameterMap"/>
@@ -67,30 +21,30 @@
</cacheModels>
<resultMaps>
- <resultMap name="account-result" class="Account" >
+ <resultMap id="account-result" class="Account" >
<result property="Id" column="Account_ID"/>
<result property="FirstName" column="Account_FirstName"/>
<result property="LastName" column="Account_LastName"/>
<result property="EmailAddress" column="Account_Email" nullValue="no_email@provided.com"/>
</resultMap>
- <resultMap name="indexed-account-result" class="Account">
+ <resultMap id="indexed-account-result" class="Account">
<result property="Id" column="Account_ID" columnIndex="0"/>
<result property="FirstName" column="Account_FirstName" columnIndex="1"/>
<result property="LastName" column="Account_LastName" columnIndex="2"/>
<result property="EmailAddress" column="Account_Email" columnIndex="3" nullValue="no_email@provided.com"/>
</resultMap>
- <resultMap name="account-result-nullable-email" class="Account">
+ <resultMap id="account-result-nullable-email" class="Account">
<result property="Id" column="Account_ID"/>
<result property="FirstName" column="Account_FirstName"/>
<result property="LastName" column="Account_LastName"/>
<result property="EmailAddress" column="Account_Email"/>
</resultMap>
- <resultMap name="email-result" class="string">
+ <resultMap id="email-result" class="string">
<result property="value" column="Account_Email"/>
</resultMap>
- <resultMap name="account-hashtable-result" class="Hashtable">
+ <resultMap id="account-hashtable-result" class="Hashtable">
<result property="Id" column="Account_ID"/>
<result property="FirstName" column="Account_FirstName"/>
<result property="LastName" column="Account_LastName"/>
@@ -104,16 +58,41 @@
=============================================
-->
<statements>
-
- <select name="GetCachedAccountsViaResultMap"
+
+ <select id="GetAccountsDynamic" resultMap="account-result" parameterClass="Hashtable" >
+ select top $MaximumAllowed$ * from Accounts
+ <dynamic prepend="where">
+ <isParameterPresent>
+ <isNotEmpty prepend="and" property="FirstName" >
+ Account_FirstName LIKE '%$FirstName$%'
+ </isNotEmpty>
+ <isNotEmpty prepend="and" property="LastName" >
+ Account_LastName LIKE '%$LastName$%'
+ </isNotEmpty>
+ <isNotEmpty prepend="and" property="EmailAddress" >
+ Account_Email LIKE '%$EmailAddress$%'
+ </isNotEmpty>
+ </isParameterPresent>
+ </dynamic>
+ order by Account_LastName
+ </select>
+
+ <select id="GetCachedAccountsViaResultMap"
resultMap="account-result"
cacheModel="account-cache" >
select *
from Accounts
order by Account_ID
</select>
+
+ <select id="SelectWithProperty"
+ resultMap="account-result">
+ select *
+ from Accounts
+ where Account_FirstName = ${accountName}
+ </select>
- <select name="GetAccountAsHashtable"
+ <select id="GetAccountAsHashtable"
parameterClass="Integer"
resultMap="account-hashtable-result">
select *
@@ -121,14 +100,14 @@
where Account_ID = #value#
</select>
- <select name="GetAllAccountsAsHashMapViaResultMap"
+ <select id="GetAllAccountsAsHashMapViaResultMap"
resultMap="account-hashtable-result">
select *
from Accounts
order by Account_ID
</select>
- <select name="GetAccountAsHashtableResultClass"
+ <select id="GetAccountAsHashtableResultClass"
parameterClass="int"
resultClass="HashMap">
select
@@ -140,7 +119,7 @@
where Account_ID = #value#
</select>
- <select name="GetAllAccountsAsHashtableViaResultClass"
+ <select id="GetAllAccountsAsHashtableViaResultClass"
resultClass="Hashtable">
select
Account_ID as Id,
@@ -151,7 +130,7 @@
order by Account_ID
</select>
- <select name="GetAccountViaColumnName"
+ <select id="GetAccountViaColumnName"
parameterClass="int"
resultMap="account-result">
select
@@ -163,7 +142,7 @@
where Account_ID = #value#
</select>
- <select name="GetAccountViaColumnIndex"
+ <select id="GetAccountViaColumnIndex"
parameterClass="int"
resultMap="indexed-account-result">
select
@@ -175,13 +154,13 @@
where Account_ID = #value#
</select>
- <select name="GetAllAccountsViaResultMap"
+ <select id="GetAllAccountsViaResultMap"
resultMap="account-result">
select * from Accounts
order by Account_ID
</select>
- <select name="GetAllAccountsViaResultClass"
+ <select id="GetAllAccountsViaResultClass"
resultClass="Account">
select
Account_ID as Id,
@@ -192,7 +171,16 @@
order by Account_ID
</select>
- <select name="GetNoAccountsViaResultMap"
+ <select id="GetFewAccountsViaResultMap"
+ resultMap="account-result">
+ <![CDATA[
+ select * from Accounts
+ where Account_ID < 2
+ order by Account_ID
+ ]]>
+ </select>
+
+ <select id="GetNoAccountsViaResultMap"
resultMap="account-result">
select * from Accounts
where Account_ID > 1000
@@ -200,7 +188,7 @@
</select>
- <select name="GetAccountNullableEmail"
+ <select id="GetAccountNullableEmail"
resultMap="account-result-nullable-email">
select
Account_ID,
@@ -211,7 +199,7 @@
where Account_ID = #value#
</select>
- <select name="GetAccountViaResultClass"
+ <select id="GetAccountViaResultClass"
resultClass="Account">
<![CDATA[
select
@@ -224,7 +212,7 @@
]]>
</select>
- <select name="GetAccountViaInlineParameters"
+ <select id="GetAccountViaInlineParameters"
resultMap="account-result">
select
Account_ID,
@@ -235,13 +223,13 @@
where Account_ID = #Id# and Account_ID = #Id#
</select>
- <select name="GetEmailAddressViaResultClass" resultClass="string">
- select Account_Email as value
+ <select id="GetEmailAddressViaResultClass" resultClass="string">
+ select Account_Email as [value]
from Accounts
where Account_ID = #value#
</select>
- <select name="GetEmailAddressViaResultMap"
+ <select id="GetEmailAddressViaResultMap"
parameterClass="int"
resultMap="email-result">
select Account_Email
@@ -249,21 +237,21 @@
where Account_ID = #value#
</select>
- <select name="GetAllEmailAddressesViaResultClass"
+ <select id="GetAllEmailAddressesViaResultClass"
resultClass="string">
select Account_Email
from Accounts
order by Account_ID
</select>
- <select name="GetAllEmailAddressesViaResultMap"
+ <select id="GetAllEmailAddressesViaResultMap"
resultMap="email-result">
select Account_Email
from Accounts
order by Account_ID
</select>
- <insert name="InsertAccountViaParameterMap"
+ <insert id="InsertAccountViaParameterMap"
parameterMap="insert-params">
insert into Accounts
(Account_ID, Account_FirstName, Account_LastName, Account_Email)
@@ -271,7 +259,7 @@
(?, ?, ?, ?)
</insert>
- <update name="UpdateAccountViaParameterMap"
+ <update id="UpdateAccountViaParameterMap"
parameterMap="update-params">
update Accounts set
Account_FirstName = ?,
@@ -281,7 +269,7 @@
Account_ID = ?
</update>
- <update name="UpdateAccountViaParameterMap2"
+ <update id="UpdateAccountViaParameterMap2"
parameterMap="update-params2">
update Accounts set
Account_ID = ?,
@@ -292,13 +280,13 @@
Account_ID = ?
</update>
- <delete name="DeleteAccountViaInlineParameters">
+ <delete id="DeleteAccountViaInlineParameters">
delete from Accounts
where
Account_ID = #Id#
</delete>
- <select name="GetAccountComplexMapping"
+ <select id="GetAccountComplexMapping"
resultMap="indexed-account-result"
parameterClass="Hashtable">
select *
@@ -308,7 +296,7 @@
And Account_LastName = #Order.City#
</select>
- <select name="GetDynamicOrderedEmailAddressesViaResultMap"
+ <select id="GetDynamicOrderedEmailAddressesViaResultMap"
resultMap="email-result">
select Account_Email
from Accounts
@@ -316,21 +304,21 @@
</select>
<!-- Dynamic statements -->
- <select name="GetAllAccountsViaResultMapWithDynamicElement"
+ <select id="GetAllAccountsViaResultMapWithDynamicElement"
resultMap="account-result">
select * from Accounts
where Account_Email $value$ '%@%'
order by Account_ID
</select>
- <select name="SimpleDynamicSubstitution"
+ <select id="SimpleDynamicSubstitution"
parameterClass="Hashtable"
resultClass="Account">
$statement$
</select>
<!-- Public Fields -->
- <insert name="InsertAccountViaPublicFields">
+ <insert id="InsertAccountViaPublicFields">
insert into Accounts
(Account_ID, Account_FirstName, Account_LastName, Account_Email)
values
@@ -339,7 +327,7 @@
</insert>
<!-- Inline Parameters -->
- <update name="UpdateAccountViaInlineParameters"
+ <update id="UpdateAccountViaInlineParameters"
parameterClass="Account">
update Accounts set
Account_FirstName = #FirstName#,
@@ -349,7 +337,7 @@
Account_ID = #Id#
</update>
- <insert name="InsertAccountViaInlineParameters"
+ <insert id="InsertAccountViaInlineParameters"
parameterClass="Account" >
insert into Accounts
(Account_ID, Account_FirstName, Account_LastName, Account_Email)
@@ -358,7 +346,7 @@
)
</insert>
- <insert name="InsertAccountNullableEmail"
+ <insert id="InsertAccountNullableEmail"
parameterClass="Account" >
insert into Accounts
(Account_ID, Account_FirstName, Account_LastName, Account_Email)
@@ -366,27 +354,57 @@
( #Id#, #FirstName#, #LastName#, #EmailAddress:VarChar# )
</insert>
- <insert name="InsertAccountUknownParameterClass">
+ <insert id="InsertAccountUknownParameterClass">
insert into Accounts
(Account_ID, Account_FirstName, Account_LastName, Account_Email)
values
( #Id#, #FirstName#, #LastName#, #EmailAddress:VarChar# )
</insert>
- <delete name="DeleteAccount"
+ <delete id="DeleteAccount"
parameterClass="Account">
delete from Accounts
where Account_ID = #Id#
and Account_ID = #Id#
</delete>
+
+ <!-- Extends statement -->
+ <select id="GetAllAccounts"
+ resultMap="account-result">
+ select
+ Account_ID,
+ Account_FirstName,
+ Account_LastName,
+ Account_Email
+ from Accounts
+ </select>
+
+ <select id="GetAllAccountsOrderByName"
+ extends="GetAllAccounts"
+ resultMap="account-result">
+ order by Account_FirstName
+ </select>
+
+ <select id="GetOneAccount"
+ extends="GetAllAccounts"
+ resultMap="account-result">
+ where Account_ID = #value#
+ </select>
+ <select id="GetSomeAccount"
+ extends="GetAllAccounts"
+ parameterClass="Hashtable"
+ resultMap="account-result">
+ where Account_ID between #lowID# and #hightID#
+ </select>
+
<!-- For procedure, the parameters of the parameterMap must in the same order
as for the procedure paramaters-->
- <procedure name="InsertAccountViaStoreProcedure" parameterMap="insert-params">
+ <procedure id="InsertAccountViaStoreProcedure" parameterMap="insert-params">
sp_InsertAccount
</procedure>
- <procedure name="SwapEmailAddresses" parameterMap="swap-params">
+ <procedure id="SwapEmailAddresses" parameterMap="swap-params">
ps_swap_email_address
</procedure>
</statements>
@@ -396,26 +414,26 @@
============================================= -->
<parameterMaps>
- <parameterMap name="swap-params">
+ <parameterMap id="swap-params">
<parameter property="email1" column="First_Email" />
<parameter property="email2" column="Second_Email" />
</parameterMap>
- <parameterMap name="insert-params">
+ <parameterMap id="insert-params">
<parameter property="Id" />
<parameter property="FirstName" />
<parameter property="LastName" />
<parameter property="EmailAddress" nullValue="no_email@provided.com"/>
</parameterMap>
- <parameterMap name="update-params">
+ <parameterMap id="update-params">
<parameter property="FirstName" />
<parameter property="LastName" />
<parameter property="EmailAddress" nullValue="no_email@provided.com"/>
<parameter property="Id" />
</parameterMap>
- <parameterMap name="update-params2">
+ <parameterMap id="update-params2">
<parameter property="Id" />
<parameter property="FirstName" />
<parameter property="LastName" />
Added: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/DataBase.sql
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/DataBase.sql?view=auto&rev=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/DataBase.sql (added)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/DataBase.sql Tue Mar 1 22:15:12 2005
@@ -0,0 +1,80 @@
+/* Certain queries must be run through ADO since Access does not
+ recognize some SQL DDL keywords/data types (such as DECIMAL
+ or DEFAULT) through the Access SQL Query window */
+
+drop table ACCOUNTS;
+
+drop table CATEGORIES;
+
+drop table ENUMERATIONS;
+
+drop table LINEITEMS;
+
+drop table ORDERS;
+
+drop table OTHERS;
+
+create table ACCOUNTS
+(
+ [ACCOUNT_ID] long not null,
+ [ACCOUNT_FIRSTNAME] text(32) not null,
+ [ACCOUNT_LASTNAME] text(32) not null,
+ [ACCOUNT_EMAIL] text(128),
+ constraint pkAccounts
+ primary key ([ACCOUNT_ID])
+);
+
+create table CATEGORIES
+(
+ [CATEGORY_ID] counter not null,
+ [CATEGORY_NAME] text(32),
+ [CATEGORY_GUID] guid,
+ constraint pkCategories
+ primary key ([CATEGORY_ID])
+);
+
+create table ENUMERATIONS
+(
+ [ENUM_ID] long not null,
+ [ENUM_DAY] long not null,
+ [ENUM_COLOR] long not null,
+ [ENUM_MONTH] long,
+ constraint pkEnumerations
+ primary key ([ENUM_ID])
+);
+
+create table LINEITEMS
+(
+ [LINEITEM_ID] long not null,
+ [ORDER_ID] long not null,
+ [LINEITEM_CODE] text(32) not null,
+ [LINEITEM_QUANTITY] long not null,
+ [LINEITEM_PRICE] decimal(18,2),
+ [LINEITEM_PICTURE] longbinary,
+ constraint pkLineItems
+ primary key ([ORDER_ID], [LINEITEM_ID])
+);
+
+create table ORDERS
+(
+ [ORDER_ID] long not null,
+ [ACCOUNT_ID] long not null,
+ [ORDER_DATE] datetime,
+ [ORDER_CARDTYPE] text(32),
+ [ORDER_CARDNUMBER] text(32),
+ [ORDER_CARDEXPIRY] text(32),
+ [ORDER_STREET] text(32),
+ [ORDER_CITY] text(32),
+ [ORDER_PROVINCE] text(32),
+ [ORDER_POSTALCODE] text(32),
+ [ORDER_FAVOURITELINEITEM] long,
+ constraint pkOrders
+ primary key ([ORDER_ID])
+);
+
+create table OTHERS
+(
+ OTHER_INT long,
+ OTHER_LONG decimal
+);
+
Added: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/DataBaseNHibernate.sql
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/DataBaseNHibernate.sql?view=auto&rev=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/DataBaseNHibernate.sql (added)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/DataBaseNHibernate.sql Tue Mar 1 22:15:12 2005
@@ -0,0 +1,16 @@
+/* Certain queries must be run through ADO since Access does not
+ recognize some SQL DDL keywords/data types (such as DECIMAL
+ or DEFAULT) through the Access SQL Query window */
+
+drop table USERS;
+
+create table USERS
+(
+ [LOGONID] text(20) not null default 0,
+ [NAME] text(40) default null,
+ [PASSWORD] text(20) default null,
+ [EMAILADDRESS] text(40) default null,
+ [LASTLOGON] datetime default null,
+ constraint pkUsers
+ primary key ([LOGONID])
+);
Added: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/account-init.sql
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/account-init.sql?view=auto&rev=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/account-init.sql (added)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/account-init.sql Tue Mar 1 22:15:12 2005
@@ -0,0 +1,17 @@
+drop table ACCOUNTS;
+
+create table ACCOUNTS
+(
+ [ACCOUNT_ID] long not null,
+ [ACCOUNT_FIRSTNAME] text(32) not null,
+ [ACCOUNT_LASTNAME] text(32) not null,
+ [ACCOUNT_EMAIL] text(128),
+ constraint pkAccounts
+ primary key ([ACCOUNT_ID])
+);
+
+INSERT INTO Accounts VALUES(1,'Joe', 'Dalton', 'Joe.Dalton@somewhere.com');
+INSERT INTO Accounts VALUES(2,'Averel', 'Dalton', 'Averel.Dalton@somewhere.com');
+INSERT INTO Accounts VALUES(3,'William', 'Dalton', null);
+INSERT INTO Accounts VALUES(4,'Jack', 'Dalton', 'Jack.Dalton@somewhere.com');
+INSERT INTO Accounts VALUES(5,'Gilles', 'Bayon', null);
\ No newline at end of file
Added: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/account-procedure.sql
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/account-procedure.sql?view=auto&rev=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/account-procedure.sql (added)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/account-procedure.sql Tue Mar 1 22:15:12 2005
@@ -0,0 +1 @@
+SELECT NULL;
\ No newline at end of file
Added: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/category-init.sql
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/category-init.sql?view=auto&rev=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/category-init.sql (added)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/category-init.sql Tue Mar 1 22:15:12 2005
@@ -0,0 +1,10 @@
+drop table CATEGORIES;
+
+create table CATEGORIES
+(
+ [CATEGORY_ID] counter not null,
+ [CATEGORY_NAME] text(32),
+ [CATEGORY_GUID] guid,
+ constraint pkCategories
+ primary key ([CATEGORY_ID])
+);
Added: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/category-procedure.sql
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/category-procedure.sql?view=auto&rev=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/category-procedure.sql (added)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/category-procedure.sql Tue Mar 1 22:15:12 2005
@@ -0,0 +1 @@
+SELECT NULL;
\ No newline at end of file
Added: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/documents-init.sql
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/documents-init.sql?view=auto&rev=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/documents-init.sql (added)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/documents-init.sql Tue Mar 1 22:15:12 2005
@@ -0,0 +1,19 @@
+drop table DOCUMENTS;
+
+create table DOCUMENTS
+(
+ [DOCUMENT_ID] long not null,
+ [DOCUMENT_TITLE] text(32),
+ [DOCUMENT_TYPE] text(32),
+ [DOCUMENT_PAGENUMBER] long,
+ [DOCUMENT_CITY] text(32),
+ constraint pkAccounts
+ primary key ([DOCUMENT_ID])
+);
+
+INSERT INTO Documents VALUES (1, 'The World of Null-A', 'Book', 55, null);
+INSERT INTO Documents VALUES (2, 'Le Progres de Lyon', 'Newspaper', null , 'Lyon');
+INSERT INTO Documents VALUES (3, 'Lord of the Rings', 'Book', 3587, null);
+INSERT INTO Documents VALUES (4, 'Le Canard enchaine', 'Tabloid', null , 'Paris');
+INSERT INTO Documents VALUES (5, 'Le Monde', 'Broadsheet', null , 'Paris');
+INSERT INTO Documents VALUES (6, 'Foundation', 'Monograph', 557, null);
Added: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/enumeration-init.sql
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/enumeration-init.sql?view=auto&rev=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/enumeration-init.sql (added)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/enumeration-init.sql Tue Mar 1 22:15:12 2005
@@ -0,0 +1,16 @@
+drop table ENUMERATIONS;
+
+create table ENUMERATIONS
+(
+ [ENUM_ID] long not null,
+ [ENUM_DAY] long not null,
+ [ENUM_COLOR] long not null,
+ [ENUM_MONTH] long,
+ constraint pkEnumerations
+ primary key ([ENUM_ID])
+);
+
+INSERT INTO Enumerations VALUES(1, 1, 1, 128);
+INSERT INTO Enumerations VALUES(2, 2, 2, 2048);
+INSERT INTO Enumerations VALUES(3, 3, 4, 256);
+INSERT INTO Enumerations VALUES(4, 4, 8, null);
Added: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/line-item-init.sql
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/line-item-init.sql?view=auto&rev=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/line-item-init.sql (added)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/line-item-init.sql Tue Mar 1 22:15:12 2005
@@ -0,0 +1,35 @@
+drop table LINEITEMS;
+
+create table LINEITEMS
+(
+ [LINEITEM_ID] long not null,
+ [ORDER_ID] long not null,
+ [LINEITEM_CODE] text(32) not null,
+ [LINEITEM_QUANTITY] long not null,
+ [LINEITEM_PRICE] decimal(18,2),
+ [LINEITEM_PICTURE] longbinary,
+ constraint pkLineItems
+ primary key ([ORDER_ID], [LINEITEM_ID])
+);
+
+INSERT INTO LineItems VALUES (1, 10, 'ESM-34', 1, 45.43, null);
+INSERT INTO LineItems VALUES (2, 10, 'QSM-98', 8, 8.40, null);
+INSERT INTO LineItems VALUES (1, 9, 'DSM-78', 2, 45.40, null);
+INSERT INTO LineItems VALUES (2, 9, 'TSM-12', 2, 32.12, null);
+INSERT INTO LineItems VALUES (1, 8, 'DSM-16', 4, 41.30, null);
+INSERT INTO LineItems VALUES (2, 8, 'GSM-65', 1, 2.20, null);
+INSERT INTO LineItems VALUES (1, 7, 'WSM-27', 7, 52.10, null);
+INSERT INTO LineItems VALUES (2, 7, 'ESM-23', 2, 123.34, null);
+INSERT INTO LineItems VALUES (1, 6, 'QSM-39', 9, 12.12, null);
+INSERT INTO LineItems VALUES (2, 6, 'ASM-45', 6, 78.77, null);
+INSERT INTO LineItems VALUES (1, 5, 'ESM-48', 3, 43.87, null);
+INSERT INTO LineItems VALUES (2, 5, 'WSM-98', 7, 5.40, null);
+INSERT INTO LineItems VALUES (1, 4, 'RSM-57', 2, 78.90, null);
+INSERT INTO LineItems VALUES (2, 4, 'XSM-78', 9, 2.34, null);
+INSERT INTO LineItems VALUES (1, 3, 'DSM-59', 3, 5.70, null);
+INSERT INTO LineItems VALUES (2, 3, 'DSM-53', 3, 98.78, null);
+INSERT INTO LineItems VALUES (1, 2, 'DSM-37', 4, 7.80, null);
+INSERT INTO LineItems VALUES (2, 2, 'FSM-12', 2, 55.78, null);
+INSERT INTO LineItems VALUES (1, 1, 'ESM-48', 8, 87.60, null);
+INSERT INTO LineItems VALUES (2, 1, 'ESM-23', 1, 55.40, null);
+
Added: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/more-account-records.sql
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/more-account-records.sql?view=auto&rev=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/more-account-records.sql (added)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/more-account-records.sql Tue Mar 1 22:15:12 2005
@@ -0,0 +1,6 @@
+INSERT INTO Accounts VALUES(6,'Jane', 'Calamity', 'Jane.Calamity@somewhere.com');
+INSERT INTO Accounts VALUES(7,'Lucky', 'Luke', 'Lucky.Luke@somewhere.com');
+INSERT INTO Accounts VALUES(8,'Ming', 'Li Foo', null);
+INSERT INTO Accounts VALUES(9,'O''Hara', 'Steve', 'Jack.OHara@somewhere.com');
+INSERT INTO Accounts VALUES(10,'Robert', 'O''Timmins', null);
+
Added: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/order-init.sql
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/order-init.sql?view=auto&rev=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/order-init.sql (added)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/order-init.sql Tue Mar 1 22:15:12 2005
@@ -0,0 +1,30 @@
+drop table ORDERS;
+
+create table ORDERS
+(
+ [ORDER_ID] long not null,
+ [ACCOUNT_ID] long not null,
+ [ORDER_DATE] datetime,
+ [ORDER_CARDTYPE] text(32),
+ [ORDER_CARDNUMBER] text(32),
+ [ORDER_CARDEXPIRY] text(32),
+ [ORDER_STREET] text(32),
+ [ORDER_CITY] text(32),
+ [ORDER_PROVINCE] text(32),
+ [ORDER_POSTALCODE] text(32),
+ [ORDER_FAVOURITELINEITEM] long,
+ constraint pkOrders
+ primary key ([ORDER_ID])
+);
+
+INSERT INTO Orders VALUES (1, 1, '2003-02-15 8:15:00', 'VISA', '999999999999', '05/03', '11 This Street', 'Victoria', 'BC', 'C4B 4F4',2);
+INSERT INTO Orders VALUES (2, 4, '2003-02-15 8:15:00', 'MC', '888888888888', '06/03', '222 That Street', 'Edmonton', 'AB', 'X4K 5Y4',1);
+INSERT INTO Orders VALUES (3, 3, '2003-02-15 8:15:00', 'AMEX', '777777777777', '07/03', '333 Other Street', 'Regina', 'SK', 'Z4U 6Y4',2);
+INSERT INTO Orders VALUES (4, 2, '2003-02-15 8:15:00', 'MC', '666666666666', '08/03', '444 His Street', 'Toronto', 'ON', 'K4U 3S4',1);
+INSERT INTO Orders VALUES (5, 5, '2003-02-15 8:15:00', 'VISA', '555555555555', '09/03', '555 Her Street', 'Calgary', 'AB', 'J4J 7S4',2);
+INSERT INTO Orders VALUES (6, 5, '2003-02-15 8:15:00', 'VISA', '999999999999', '10/03', '6 Their Street', 'Victoria', 'BC', 'T4H 9G4',1);
+INSERT INTO Orders VALUES (7, 4, '2003-02-15 8:15:00', 'MC', '888888888888', '11/03', '77 Lucky Street', 'Edmonton', 'AB', 'R4A 0Z4',2);
+INSERT INTO Orders VALUES (8, 3, '2003-02-15 8:15:00', 'AMEX', '777777777777', '12/03', '888 Our Street', 'Regina', 'SK', 'S4S 7G4',1);
+INSERT INTO Orders VALUES (9, 2, '2003-02-15 8:15:00', 'MC', '666666666666', '01/04', '999 Your Street', 'Toronto', 'ON', 'G4D 9F4',2);
+INSERT INTO Orders VALUES (10, 1, '2003-02-15 8:15:00', 'VISA', '555555555555', '02/04', '99 Some Street', 'Calgary', 'AB', 'W4G 7A4',1);
+
Added: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/other-init.sql
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/other-init.sql?view=auto&rev=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/other-init.sql (added)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/other-init.sql Tue Mar 1 22:15:12 2005
@@ -0,0 +1,10 @@
+drop table OTHERS;
+
+create table OTHERS
+(
+ OTHER_INT long,
+ OTHER_LONG decimal
+);
+
+INSERT INTO Others VALUES(1, 8888888);
+INSERT INTO Others VALUES(2, 9999999999);
\ No newline at end of file
Added: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/swap-procedure.sql
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/swap-procedure.sql?view=auto&rev=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/swap-procedure.sql (added)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/swap-procedure.sql Tue Mar 1 22:15:12 2005
@@ -0,0 +1 @@
+SELECT NULL;
\ No newline at end of file
Added: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/user-init.sql
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/user-init.sql?view=auto&rev=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/user-init.sql (added)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Scripts/Access/user-init.sql Tue Mar 1 22:15:12 2005
@@ -0,0 +1,12 @@
+drop table USERS;
+
+create table USERS
+(
+ [LOGONID] text(20) not null default 0,
+ [NAME] text(40) default null,
+ [PASSWORD] text(20) default null,
+ [EMAILADDRESS] text(40) default null,
+ [LASTLOGON] datetime default null,
+ constraint pkUsers
+ primary key ([LOGONID])
+);
Added: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/bin/Debug/SqlMap_Access_OleDb.config
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/bin/Debug/SqlMap_Access_OleDb.config?view=auto&rev=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/bin/Debug/SqlMap_Access_OleDb.config (added)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/bin/Debug/SqlMap_Access_OleDb.config Tue Mar 1 22:15:12 2005
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<sqlMapConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="SqlMapConfig.xsd">
+
+ <settings>
+ <setting useStatementNamespaces="false"/>
+ <setting cacheModelsEnabled="true"/>
+ </settings>
+
+ <properties resource="Database.config"/>
+
+ <!-- ==== OleDb configuration ========= -->
+ <database>
+ <provider name="OleDb1.1"/>
+ <dataSource name="iBatisNetOLEDB" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.mdb;User Id=admin;Password=;"/>
+ </database>
+
+ <alias>
+ <typeAlias alias="Account" type="IBatisNet.Common.Test.Domain.Account, IBatisNet.Common.Test" />
+ </alias>
+
+ <sqlMaps>
+ <sqlMap resource="Maps\Access\OleDb\Account.xml"/>
+ </sqlMaps>
+
+</sqlMapConfig>
Added: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/bin/Debug/dao_Access_OleDb.config
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/bin/Debug/dao_Access_OleDb.config?view=auto&rev=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/bin/Debug/dao_Access_OleDb.config (added)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/bin/Debug/dao_Access_OleDb.config Tue Mar 1 22:15:12 2005
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+<daoConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="DaoConfig.xsd">
+
+ <daoSessionHandlers>
+ <handler id="NHibernate"
+ implementation="IBatisNet.DataAccess.Extensions.DaoSessionHandlers.NHibernateDaoSessionHandler, IBatisNet.DataAccess.Extensions">
+ </handler>
+ </daoSessionHandlers>
+
+ <context id="SimpleDao" default="true">
+
+ <properties resource="Database.config"/>
+
+ <!-- ==== OleDb configuration ========= -->
+ <database>
+ <provider name="OleDb1.1"/>
+ <dataSource name="iBatisNet" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.mdb;User Id=admin;Password=;"/>
+ </database>
+
+ <daoFactory>
+ <dao interface="IBatisNet.DataAccess.Test.Dao.Interfaces.IAccountDao, IBatisNet.DataAccess.Test" implementation="IBatisNet.DataAccess.Test.Dao.Implementations.Ado.AccountDao, IBatisNet.DataAccess.Test"/>
+ </daoFactory>
+ </context>
+
+ <context id="SqlMapDao">
+
+ <properties resource="Database.config"/>
+
+ <!-- ==== OleDb configuration ========= -->
+ <database>
+ <provider name="OleDb1.1"/>
+ <dataSource name="iBatisNet" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.mdb;User Id=admin;Password=;" />
+ </database>
+
+ <daoSessionHandler id="SqlMap">
+ <property name="sqlMapConfigFile" value="SqlMap_Access_OleDb.config"/>
+ </daoSessionHandler>
+
+ <daoFactory>
+ <dao interface="IBatisNet.DataAccess.Test.Dao.Interfaces.IAccountDao, IBatisNet.DataAccess.Test"
+ implementation="IBatisNet.DataAccess.Test.Dao.Implementations.DataMapper.AccountDao, IBatisNet.DataAccess.Test"/>
+ </daoFactory>
+ </context>
+
+ <context id="NHibernateDao">
+ <properties resource="Database.config"/>
+
+ <database>
+ <provider name="OleDb1.1"/>
+ <dataSource name="NHibernate" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\projects\ibatis\asf\trunk\cs\mapper\NHibernate.mdb;User Id=admin;Password=;" />
+ </database>
+
+ <daoSessionHandler id="NHibernate">
+ <property name="hibernate.dialect" value="NHibernate.Dialect.GenericDialect"/>
+ <property name="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
+ <property name="hibernate.connection.driver_class" value="NHibernate.Driver.OleDbDriver"/>
+ <property name="mapping" value="IBatisNet.DataAccess.Test"/>
+ <property name="show_sql" value="false"/>
+ <property name="use_outer_join" value="true"/>
+ </daoSessionHandler>
+
+ <daoFactory>
+ <dao interface="IBatisNet.DataAccess.Test.Dao.Interfaces.IUserDao, IBatisNet.DataAccess.Test" implementation="IBatisNet.DataAccess.Test.Dao.Implementations.NHibernate.UserDao, IBatisNet.DataAccess.Test"/>
+ </daoFactory>
+ </context>
+
+</daoConfig>
Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common/IBatisNet.Common.csproj
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common/IBatisNet.Common.csproj?view=diff&r1=155889&r2=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common/IBatisNet.Common.csproj (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common/IBatisNet.Common.csproj Tue Mar 1 22:15:12 2005
@@ -80,11 +80,6 @@
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll"
/>
<Reference
- Name = "log4net"
- AssemblyName = "log4net"
- HintPath = "..\External-Bin\Net\1.1\log4net.dll"
- />
- <Reference
Name = "System.Web"
AssemblyName = "System.Web"
HintPath = "D:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Web.dll"
@@ -93,6 +88,11 @@
Name = "System.EnterpriseServices"
AssemblyName = "System.EnterpriseServices"
HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.EnterpriseServices.dll"
+ />
+ <Reference
+ Name = "log4net"
+ AssemblyName = "log4net"
+ HintPath = "..\External-Bin\Net\1.1\log4net.dll"
/>
</References>
</Build>
Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/ScriptRunner.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/ScriptRunner.cs?view=diff&r1=155889&r2=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/ScriptRunner.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/ScriptRunner.cs Tue Mar 1 22:15:12 2005
@@ -73,6 +73,7 @@
case "oracle9.2":
case "oracleClient1.0":
case "ByteFx":
+ case "OleDb1.1":
sqlStatements = ParseScript(script);
break;
default:
@@ -85,6 +86,7 @@
case "oracle9.2":
case "oracleClient1.0":
case "ByteFx":
+ case "OleDb1.1":
script = script.Replace("\r\n"," ");
script = script.Replace("\t"," ");
sqlStatements.Add(script);
Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/IBatisNet.DataAccess.Test.csproj
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/IBatisNet.DataAccess.Test.csproj?view=diff&r1=155889&r2=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/IBatisNet.DataAccess.Test.csproj (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/IBatisNet.DataAccess.Test.csproj Tue Mar 1 22:15:12 2005
@@ -100,14 +100,19 @@
Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"
/>
<Reference
+ Name = "System.Drawing"
+ AssemblyName = "System.Drawing"
+ HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
+ />
+ <Reference
Name = "NHibernate"
AssemblyName = "NHibernate"
HintPath = "..\External-Bin\Net\1.1\NHibernate.dll"
/>
<Reference
- Name = "System.Drawing"
- AssemblyName = "System.Drawing"
- HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
+ Name = "nunit.framework"
+ AssemblyName = "nunit.framework"
+ HintPath = "..\External-Bin\Net\1.1\nunit.framework.dll"
/>
</References>
</Build>
@@ -139,6 +144,10 @@
BuildAction = "EmbeddedResource"
/>
<File
+ RelPath = "bin\Debug\dao_Access_OleDb.config"
+ BuildAction = "None"
+ />
+ <File
RelPath = "bin\Debug\dao_MSSQL_Odbc.config"
BuildAction = "None"
/>
@@ -171,6 +180,10 @@
BuildAction = "None"
/>
<File
+ RelPath = "bin\Debug\SqlMap_Access_OleDb.config"
+ BuildAction = "None"
+ />
+ <File
RelPath = "bin\Debug\SqlMap_MSSQL_Odbc.config"
BuildAction = "None"
/>
@@ -311,6 +324,10 @@
BuildAction = "Content"
/>
<File
+ RelPath = "Maps\Access\OleDb\Document.xml"
+ BuildAction = "Content"
+ />
+ <File
RelPath = "Maps\Access\OleDb\DynamicAccount.xml"
BuildAction = "Content"
/>
@@ -327,6 +344,14 @@
BuildAction = "Content"
/>
<File
+ RelPath = "Maps\Access\OleDb\Other.xml"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Maps\Access\OleDb\ResultClass.xml"
+ BuildAction = "Content"
+ />
+ <File
RelPath = "Maps\MSSQL\Odbc\Account.xml"
BuildAction = "Content"
/>
@@ -552,6 +577,62 @@
RelPath = "NUnit\DaoTests\ADO\Oracle\AdoDaoTest.cs"
SubType = "Code"
BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Scripts\Access\account-init.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\account-procedure.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\category-init.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\category-procedure.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\DataBase.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\DataBaseNHibernate.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\documents-init.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\enumeration-init.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\line-item-init.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\more-account-records.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\order-init.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\other-init.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\swap-procedure.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\Access\user-init.sql"
+ BuildAction = "Content"
/>
<File
RelPath = "Scripts\MSSQL\account-init.sql"
Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Account.xml
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Account.xml?view=diff&r1=155889&r2=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Account.xml (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Account.xml Tue Mar 1 22:15:12 2005
@@ -1,56 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
-<sqlMap name="Account" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="..\..\Nausicaa.Framework.Dal\Schemas\SqlMap.xsd">
-
- <alias>
- <typeAlias name="Account" assembly="IBatisNet.Test.dll" class="IBatisNet.Test.Domain.Account" />
- </alias>
-
- <!-- =============================================
- <resultMap
- name="name"
- class="name"
- extend="resultMap"
- >
- <result
- property="name"
- column="name"
- columnIndex="name"
- nullValue="value"
- select="name"
- resultMap="name"
- lazyLoad="true/false"
- dbType=""
- />
- <procedure
- name="name"
- parameterMap="name"
- >
- <statement
- name="name"
- parameterClass="name"
- parameterMap="name"
- resultClass="name"
- resultMap="name"
- listClass="name"
- >
- <parameterMap
- name="name"
- class=""
- >
- <parameter
- property="name"
- dbType=""
- output="true/false"
- type=""
- nullValue=""
- />
-
- ============================================= -->
-
+<sqlMap namespace="Account" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="SqlMap.xsd">
+
<cacheModels>
- <cacheModel name="account-cache" implementation="MEMORY" >
+ <cacheModel id="account-cache" implementation="MEMORY" >
<flushInterval hours="24"/>
<flushOnExecute statement="UpdateAccountViaInlineParameters"/>
<flushOnExecute statement="UpdateAccountViaParameterMap"/>
@@ -67,30 +21,30 @@
</cacheModels>
<resultMaps>
- <resultMap name="account-result" class="Account" >
+ <resultMap id="account-result" class="Account" >
<result property="Id" column="Account_ID"/>
<result property="FirstName" column="Account_FirstName"/>
<result property="LastName" column="Account_LastName"/>
<result property="EmailAddress" column="Account_Email" nullValue="no_email@provided.com"/>
</resultMap>
- <resultMap name="indexed-account-result" class="Account">
+ <resultMap id="indexed-account-result" class="Account">
<result property="Id" column="Account_ID" columnIndex="0"/>
<result property="FirstName" column="Account_FirstName" columnIndex="1"/>
<result property="LastName" column="Account_LastName" columnIndex="2"/>
<result property="EmailAddress" column="Account_Email" columnIndex="3" nullValue="no_email@provided.com"/>
</resultMap>
- <resultMap name="account-result-nullable-email" class="Account">
+ <resultMap id="account-result-nullable-email" class="Account">
<result property="Id" column="Account_ID"/>
<result property="FirstName" column="Account_FirstName"/>
<result property="LastName" column="Account_LastName"/>
<result property="EmailAddress" column="Account_Email"/>
</resultMap>
- <resultMap name="email-result" class="string">
+ <resultMap id="email-result" class="string">
<result property="value" column="Account_Email"/>
</resultMap>
- <resultMap name="account-hashtable-result" class="Hashtable">
+ <resultMap id="account-hashtable-result" class="Hashtable">
<result property="Id" column="Account_ID"/>
<result property="FirstName" column="Account_FirstName"/>
<result property="LastName" column="Account_LastName"/>
@@ -104,16 +58,41 @@
=============================================
-->
<statements>
-
- <select name="GetCachedAccountsViaResultMap"
+
+ <select id="GetAccountsDynamic" resultMap="account-result" parameterClass="Hashtable" >
+ select top $MaximumAllowed$ * from Accounts
+ <dynamic prepend="where">
+ <isParameterPresent>
+ <isNotEmpty prepend="and" property="FirstName" >
+ Account_FirstName LIKE '%$FirstName$%'
+ </isNotEmpty>
+ <isNotEmpty prepend="and" property="LastName" >
+ Account_LastName LIKE '%$LastName$%'
+ </isNotEmpty>
+ <isNotEmpty prepend="and" property="EmailAddress" >
+ Account_Email LIKE '%$EmailAddress$%'
+ </isNotEmpty>
+ </isParameterPresent>
+ </dynamic>
+ order by Account_LastName
+ </select>
+
+ <select id="GetCachedAccountsViaResultMap"
resultMap="account-result"
cacheModel="account-cache" >
select *
from Accounts
order by Account_ID
</select>
+
+ <select id="SelectWithProperty"
+ resultMap="account-result">
+ select *
+ from Accounts
+ where Account_FirstName = ${accountName}
+ </select>
- <select name="GetAccountAsHashtable"
+ <select id="GetAccountAsHashtable"
parameterClass="Integer"
resultMap="account-hashtable-result">
select *
@@ -121,14 +100,14 @@
where Account_ID = #value#
</select>
- <select name="GetAllAccountsAsHashMapViaResultMap"
+ <select id="GetAllAccountsAsHashMapViaResultMap"
resultMap="account-hashtable-result">
select *
from Accounts
order by Account_ID
</select>
- <select name="GetAccountAsHashtableResultClass"
+ <select id="GetAccountAsHashtableResultClass"
parameterClass="int"
resultClass="HashMap">
select
@@ -140,7 +119,7 @@
where Account_ID = #value#
</select>
- <select name="GetAllAccountsAsHashtableViaResultClass"
+ <select id="GetAllAccountsAsHashtableViaResultClass"
resultClass="Hashtable">
select
Account_ID as Id,
@@ -151,7 +130,7 @@
order by Account_ID
</select>
- <select name="GetAccountViaColumnName"
+ <select id="GetAccountViaColumnName"
parameterClass="int"
resultMap="account-result">
select
@@ -163,7 +142,7 @@
where Account_ID = #value#
</select>
- <select name="GetAccountViaColumnIndex"
+ <select id="GetAccountViaColumnIndex"
parameterClass="int"
resultMap="indexed-account-result">
select
@@ -175,13 +154,13 @@
where Account_ID = #value#
</select>
- <select name="GetAllAccountsViaResultMap"
+ <select id="GetAllAccountsViaResultMap"
resultMap="account-result">
select * from Accounts
order by Account_ID
</select>
- <select name="GetAllAccountsViaResultClass"
+ <select id="GetAllAccountsViaResultClass"
resultClass="Account">
select
Account_ID as Id,
@@ -192,7 +171,16 @@
order by Account_ID
</select>
- <select name="GetNoAccountsViaResultMap"
+ <select id="GetFewAccountsViaResultMap"
+ resultMap="account-result">
+ <![CDATA[
+ select * from Accounts
+ where Account_ID < 2
+ order by Account_ID
+ ]]>
+ </select>
+
+ <select id="GetNoAccountsViaResultMap"
resultMap="account-result">
select * from Accounts
where Account_ID > 1000
@@ -200,7 +188,7 @@
</select>
- <select name="GetAccountNullableEmail"
+ <select id="GetAccountNullableEmail"
resultMap="account-result-nullable-email">
select
Account_ID,
@@ -211,7 +199,7 @@
where Account_ID = #value#
</select>
- <select name="GetAccountViaResultClass"
+ <select id="GetAccountViaResultClass"
resultClass="Account">
<![CDATA[
select
@@ -224,7 +212,7 @@
]]>
</select>
- <select name="GetAccountViaInlineParameters"
+ <select id="GetAccountViaInlineParameters"
resultMap="account-result">
select
Account_ID,
@@ -235,13 +223,13 @@
where Account_ID = #Id# and Account_ID = #Id#
</select>
- <select name="GetEmailAddressViaResultClass" resultClass="string">
- select Account_Email as value
+ <select id="GetEmailAddressViaResultClass" resultClass="string">
+ select Account_Email as [value]
from Accounts
where Account_ID = #value#
</select>
- <select name="GetEmailAddressViaResultMap"
+ <select id="GetEmailAddressViaResultMap"
parameterClass="int"
resultMap="email-result">
select Account_Email
@@ -249,21 +237,21 @@
where Account_ID = #value#
</select>
- <select name="GetAllEmailAddressesViaResultClass"
+ <select id="GetAllEmailAddressesViaResultClass"
resultClass="string">
select Account_Email
from Accounts
order by Account_ID
</select>
- <select name="GetAllEmailAddressesViaResultMap"
+ <select id="GetAllEmailAddressesViaResultMap"
resultMap="email-result">
select Account_Email
from Accounts
order by Account_ID
</select>
- <insert name="InsertAccountViaParameterMap"
+ <insert id="InsertAccountViaParameterMap"
parameterMap="insert-params">
insert into Accounts
(Account_ID, Account_FirstName, Account_LastName, Account_Email)
@@ -271,7 +259,7 @@
(?, ?, ?, ?)
</insert>
- <update name="UpdateAccountViaParameterMap"
+ <update id="UpdateAccountViaParameterMap"
parameterMap="update-params">
update Accounts set
Account_FirstName = ?,
@@ -281,7 +269,7 @@
Account_ID = ?
</update>
- <update name="UpdateAccountViaParameterMap2"
+ <update id="UpdateAccountViaParameterMap2"
parameterMap="update-params2">
update Accounts set
Account_ID = ?,
@@ -292,13 +280,13 @@
Account_ID = ?
</update>
- <delete name="DeleteAccountViaInlineParameters">
+ <delete id="DeleteAccountViaInlineParameters">
delete from Accounts
where
Account_ID = #Id#
</delete>
- <select name="GetAccountComplexMapping"
+ <select id="GetAccountComplexMapping"
resultMap="indexed-account-result"
parameterClass="Hashtable">
select *
@@ -308,7 +296,7 @@
And Account_LastName = #Order.City#
</select>
- <select name="GetDynamicOrderedEmailAddressesViaResultMap"
+ <select id="GetDynamicOrderedEmailAddressesViaResultMap"
resultMap="email-result">
select Account_Email
from Accounts
@@ -316,21 +304,21 @@
</select>
<!-- Dynamic statements -->
- <select name="GetAllAccountsViaResultMapWithDynamicElement"
+ <select id="GetAllAccountsViaResultMapWithDynamicElement"
resultMap="account-result">
select * from Accounts
where Account_Email $value$ '%@%'
order by Account_ID
</select>
- <select name="SimpleDynamicSubstitution"
+ <select id="SimpleDynamicSubstitution"
parameterClass="Hashtable"
resultClass="Account">
$statement$
</select>
<!-- Public Fields -->
- <insert name="InsertAccountViaPublicFields">
+ <insert id="InsertAccountViaPublicFields">
insert into Accounts
(Account_ID, Account_FirstName, Account_LastName, Account_Email)
values
@@ -339,7 +327,7 @@
</insert>
<!-- Inline Parameters -->
- <update name="UpdateAccountViaInlineParameters"
+ <update id="UpdateAccountViaInlineParameters"
parameterClass="Account">
update Accounts set
Account_FirstName = #FirstName#,
@@ -349,7 +337,7 @@
Account_ID = #Id#
</update>
- <insert name="InsertAccountViaInlineParameters"
+ <insert id="InsertAccountViaInlineParameters"
parameterClass="Account" >
insert into Accounts
(Account_ID, Account_FirstName, Account_LastName, Account_Email)
@@ -358,7 +346,7 @@
)
</insert>
- <insert name="InsertAccountNullableEmail"
+ <insert id="InsertAccountNullableEmail"
parameterClass="Account" >
insert into Accounts
(Account_ID, Account_FirstName, Account_LastName, Account_Email)
@@ -366,27 +354,57 @@
( #Id#, #FirstName#, #LastName#, #EmailAddress:VarChar# )
</insert>
- <insert name="InsertAccountUknownParameterClass">
+ <insert id="InsertAccountUknownParameterClass">
insert into Accounts
(Account_ID, Account_FirstName, Account_LastName, Account_Email)
values
( #Id#, #FirstName#, #LastName#, #EmailAddress:VarChar# )
</insert>
- <delete name="DeleteAccount"
+ <delete id="DeleteAccount"
parameterClass="Account">
delete from Accounts
where Account_ID = #Id#
and Account_ID = #Id#
</delete>
+
+ <!-- Extends statement -->
+ <select id="GetAllAccounts"
+ resultMap="account-result">
+ select
+ Account_ID,
+ Account_FirstName,
+ Account_LastName,
+ Account_Email
+ from Accounts
+ </select>
+
+ <select id="GetAllAccountsOrderByName"
+ extends="GetAllAccounts"
+ resultMap="account-result">
+ order by Account_FirstName
+ </select>
+
+ <select id="GetOneAccount"
+ extends="GetAllAccounts"
+ resultMap="account-result">
+ where Account_ID = #value#
+ </select>
+ <select id="GetSomeAccount"
+ extends="GetAllAccounts"
+ parameterClass="Hashtable"
+ resultMap="account-result">
+ where Account_ID between #lowID# and #hightID#
+ </select>
+
<!-- For procedure, the parameters of the parameterMap must in the same order
as for the procedure paramaters-->
- <procedure name="InsertAccountViaStoreProcedure" parameterMap="insert-params">
+ <procedure id="InsertAccountViaStoreProcedure" parameterMap="insert-params">
sp_InsertAccount
</procedure>
- <procedure name="SwapEmailAddresses" parameterMap="swap-params">
+ <procedure id="SwapEmailAddresses" parameterMap="swap-params">
ps_swap_email_address
</procedure>
</statements>
@@ -396,26 +414,26 @@
============================================= -->
<parameterMaps>
- <parameterMap name="swap-params">
+ <parameterMap id="swap-params">
<parameter property="email1" column="First_Email" />
<parameter property="email2" column="Second_Email" />
</parameterMap>
- <parameterMap name="insert-params">
+ <parameterMap id="insert-params">
<parameter property="Id" />
<parameter property="FirstName" />
<parameter property="LastName" />
<parameter property="EmailAddress" nullValue="no_email@provided.com"/>
</parameterMap>
- <parameterMap name="update-params">
+ <parameterMap id="update-params">
<parameter property="FirstName" />
<parameter property="LastName" />
<parameter property="EmailAddress" nullValue="no_email@provided.com"/>
<parameter property="Id" />
</parameterMap>
- <parameterMap name="update-params2">
+ <parameterMap id="update-params2">
<parameter property="Id" />
<parameter property="FirstName" />
<parameter property="LastName" />
Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Category.xml
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Category.xml?view=diff&r1=155889&r2=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Category.xml (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Category.xml Tue Mar 1 22:15:12 2005
@@ -1,54 +1,185 @@
<?xml version="1.0" encoding="utf-8"?>
-<sqlMap name="Category" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="..\..\Nausicaa.Framework.Dal\Schemas\SqlMap.xsd">
+<sqlMap namespace="Category" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="SqlMap.xsd">
<alias>
- <typeAlias name="Category" assembly="IBatisNet.Test.dll" class="IBatisNet.Test.Domain.Category"/>
+ <typeAlias alias="Category" type="IBatisNet.DataAccess.Test.Domain.Category, IBatisNet.DataAccess.Test"/>
</alias>
<statements>
- <select name="GetCategory" parameterClass="Integer" resultClass="Category">
+ <select id="GetCategory" parameterClass="Integer" resultClass="Category">
select
- Category_ID as Id,
- Category_Name as Name,
- Category_Guid as Guid
+ Category_ID as [Id],
+ Category_Name as [Name],
+ Category_Guid as [Guid]
from Categories
where Category_ID = #value#
</select>
<!-- Test for statement as insert -->
- <statement name="InsertCategory" parameterClass="Category" resultClass="int">
+ <!-- Needs to be <insert> vs <statement> for Access due to selectKey -->
+ <insert id="InsertCategory" parameterClass="Category" resultClass="int">
+ <selectKey property="Id" type="post" resultClass="int">
+ select @@IDENTITY as [value];
+ </selectKey>
insert into Categories
(Category_Name, Category_Guid)
values
(#Name#, #Guid:Guid#);
- select SCOPE_IDENTITY() as value
- </statement><!--Guid for Oledb, UniqueIdentifier for SqlClient,Odbc -->
-
- <!-- -->
- <insert name="InsertCategoryViaInsertSatement" parameterClass="Category" >
+ </insert><!--Guid for Oledb, UniqueIdentifier for SqlClient,Odbc -->
+
+ <!-- Test for Guid Parameter Class-->
+ <statement id="InsertCategoryGuidParameterClass" parameterClass="Guid" resultClass="int">
+ <selectKey property="Id" type="post" resultClass="int">
+ select @@IDENTITY as [value];
+ </selectKey>
+ insert into Categories
+ (Category_Name, Category_Guid)
+ values
+ ('toto', #value:Guid#);
+ </statement><!--Guid for Oledb, UniqueIdentifier for SqlClient,Odbc -->
+
+ <!-- JIRA 20 Test without specifying the dbtype-->
+ <statement id="InsertCategoryGuidParameterClassJIRA20" parameterClass="Guid" resultClass="int">
+ <selectKey property="Id" type="post" resultClass="int">
+ select @@IDENTITY as [value];
+ </selectKey>
+ insert into Categories
+ (Category_Name, Category_Guid)
+ values
+ ('toto', #value#);
+ </statement>
+
+ <insert id="InsertCategoryViaInsertStatement" parameterClass="Category" >
<selectKey property="Id" type="post" resultClass="int">
- select @@IDENTITY as value
+ select @@IDENTITY as [value];
</selectKey>
insert into Categories
(Category_Name, Category_Guid)
values
- (#Name#, #Guid:Guid#)
+ (#Name#, #Guid:Guid#);
</insert><!--Guid for Oledb, UniqueIdentifier for SqlClient, Odbc -->
- <procedure name="InsertCategoryViaStoreProcedure" parameterMap="insert-params">
+ <statement id="InsertCategoryViaParameterMap" parameterMap="InsertParam" resultClass="int">
+ <selectKey property="Id" type="post" resultClass="int">
+ select @@IDENTITY as [value];
+ </selectKey>
+ insert into Categories
+ (Category_Name, Category_Guid)
+ values
+ (?,?);
+ </statement>
+
+ <!-- Needs to be <insert> vs <statement> for Access due to selectKey -->
+ <insert id="InsertCategoryNull" parameterMap="insert-null-params" resultClass="int">
+ <selectKey property="Id" type="post" resultClass="int">
+ select @@IDENTITY as [value];
+ </selectKey>
+ insert into Categories
+ (Category_Name, Category_Guid)
+ values
+ (?,?);
+ </insert>
+
+ <update id="UpdateCategoryViaParameterMap" parameterMap="UpdateParam">
+ update Categories set
+ Category_Name =?,
+ Category_Guid = ?
+ where
+ Category_Id = ?
+ </update>
+
+ <procedure id="InsertCategoryViaStoreProcedure" parameterMap="insert-params">
sp_InsertCategorie
</procedure>
+
+ <insert id="InsertCategoryGenerate" parameterMap="insert-generate-params">
+ <selectKey property="Id" type="post" resultClass="int">
+ select @@IDENTITY as [value]
+ </selectKey>
+ <generate table="Categories" />
+ </insert>
+
+ <update id="UpdateCategoryGenerate" parameterMap="update-generate-params">
+ <generate table="Categories" by="Category_Id"/>
+ </update>
+
+ <delete id="DeleteCategoryGenerate" parameterMap="delete-generate-params">
+ <generate table="Categories" by="Category_Id, Category_Name"/>
+ </delete>
+
+ <select id="SelectByPKCategoryGenerate" resultClass="Category" parameterClass="Category" parameterMap="select-generate-params">
+ <generate table="Categories" by="Category_Id"/>
+ </select>
+ <select id="SelectAllCategoryGenerate" resultClass="Category" parameterMap="select-generate-params">
+ <generate table="Categories" />
+ </select>
+
+ <statement id="DynamicGuid"
+ resultClass="Category"
+ parameterClass="Category">
+ select
+ Category_ID as [Id],
+ Category_Name as [Name],
+ Category_Guid as [Guid]
+ from Categories
+ <dynamic prepend="where">
+ <isNotEqual prepend="and" property="Guid" compareProperty="EmptyGuid">
+ Category_Guid=#Guid:Guid#
+ </isNotEqual>
+ </dynamic>
+ </statement>
</statements>
<parameterMaps>
- <parameterMap name="insert-params">
+ <parameterMap id="insert-params">
<parameter property="Id" column="Category_Id" dbType="Integer" /><!-- Int for SqlClient, Obdc; Integer for Oledb -->
<parameter property="Name" column="Category_Name"/>
<parameter property="Guid" column="Category_Guid" dbType="Guid"/><!--Guid for Oledb, UniqueIdentifier for SqlClient,Odbc -->
</parameterMap>
+
+ <parameterMap id="InsertParam">
+ <parameter property="Name" column="Category_Name"/>
+ <parameter property="Guid" column="Category_Guid" dbType="Guid"/><!--Guid for Oledb, UniqueIdentifier for SqlClient,Odbc -->
+ </parameterMap>
+
+ <parameterMap id="insert-null-params">
+ <parameter property="Name" column="Category_Name"/>
+ <parameter property="Guid" column="Category_Guid" nullValue="00000000-0000-0000-0000-000000000000" dbType="Guid"/><!--Guid for Oledb, UniqueIdentifier for SqlClient,Odbc -->
+ </parameterMap>
+
+ <parameterMap id="UpdateParam" extends="InsertParam">
+ <parameter property="Id" column="Category_Id" />
+ </parameterMap>
+
+ <!-- Used by generated statement -->
+
+ <parameterMap id="insert-generate-params">
+ <parameter property="Name" column="Category_Name"/>
+ <parameter property="Guid" column="Category_Guid" dbType="Guid"/><!--Guid for Oledb, UniqueIdentifier for SqlClient,Odbc -->
+ </parameterMap>
+
+ <parameterMap id="update-generate-params" extends="insert-generate-params">
+ <parameter property="Id" column="Category_Id" />
+ </parameterMap>
+
+ <parameterMap id="delete-generate-params">
+ <parameter property="Id" column="Category_Id" />
+ <parameter property="Name" column="Category_Name"/>
+ </parameterMap>
+
+ <parameterMap id="selectByPK-generate-params">
+ <parameter property="Id" column="Category_Id" />
+ </parameterMap>
+
+ <parameterMap id="select-generate-params">
+ <parameter property="Id" column="Category_Id" />
+ <parameter property="Name" column="Category_Name"/>
+ <parameter property="Guid" column="Category_Guid" dbType="Guid"/>
+ </parameterMap>
+
</parameterMaps>
</sqlMap>
Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Complex.xml
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Complex.xml?view=diff&r1=155889&r2=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Complex.xml (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Complex.xml Tue Mar 1 22:15:12 2005
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
-<sqlMap name="Category" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="..\..\Nausicaa.Framework.Dal\Schemas\SqlMap.xsd">
+<sqlMap namespace="Category" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="SqlMap.xsd">
<statements>
- <statement name="ComplexMap"
+ <statement id="ComplexMap"
resultClass="int" >
select Account_ID from Accounts where Account_ID = #obj.Map.Id#
</statement>
Added: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Document.xml
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Document.xml?view=auto&rev=155890
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Document.xml (added)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataAccess.Test/Maps/Access/OleDb/Document.xml Tue Mar 1 22:15:12 2005
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<sqlMap namespace="Document" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="SqlMap.xsd">
+
+ <alias>
+ <typeAlias alias="Document" type="IBatisNet.DataAccess.Test.Domain.Document, IBatisNet.DataAccess.Test" />
+ <typeAlias alias="Book" type="IBatisNet.DataAccess.Test.Domain.Book, IBatisNet.DataAccess.Test" />
+ <typeAlias alias="Newspaper" type="IBatisNet.DataAccess.Test.Domain.Newspaper, IBatisNet.DataAccess.Test" />
+ <typeAlias alias="MyFormula" type="IBatisNet.DataAccess.Test.Domain.MyFormula, IBatisNet.DataAccess.Test" />
+ </alias>
+
+ <resultMaps>
+ <resultMap id="document" class="Document">
+ <result property="Id" column="Document_ID"/>
+ <result property="Title" column="Document_Title"/>
+ <discriminator column="Document_Type" />
+ <subMap value="Book" resultMapping="book" />
+ <subMap value="Newspaper" resultMapping="newspaper" />
+ </resultMap>
+
+ <resultMap id="document-custom-formula" class="Document">
+ <result property="Id" column="Document_ID"/>
+ <result property="Title" column="Document_Title"/>
+ <discriminator formula="MyFormula" />
+ <subMap value="Book" resultMapping="book" />
+ <subMap value="Newspaper" resultMapping="newspaper" />
+ </resultMap>
+
+ <resultMap id="book" class="Book" extends="document">
+ <result property="PageNumber" column="Document_PageNumber"/>
+ </resultMap>
+
+ <resultMap id="newspaper" class="Newspaper" extends="document">
+ <result property="City" column="Document_City"/>
+ </resultMap>
+
+ </resultMaps>
+
+ <statements>
+
+ <statement id="GetAllDocument"
+ resultMap="document">
+ select
+ *
+ from Documents
+ order by Document_Type, Document_Id
+ </statement>
+
+ <statement id="GetAllDocumentWithFormula"
+ resultMap="document-custom-formula">
+ select
+ *
+ from Documents
+ order by Document_Type, Document_Id
+ </statement>
+
+ </statements>
+
+
+</sqlMap>
\ No newline at end of file