ibatis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gba...@apache.org
Subject svn commit: r464979 - in /ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test: Maps/MSSQL/SqlClient/DynamicAccount.xml Scripts/MSSQL/account-init.sql Scripts/MSSQL/order-init.sql
Date Tue, 17 Oct 2006 17:57:28 GMT
Author: gbayon
Date: Tue Oct 17 10:57:27 2006
New Revision: 464979

URL: http://svn.apache.org/viewvc?view=rev&rev=464979
Log:
cleaning tests

Modified:
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/DynamicAccount.xml
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/account-init.sql
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/order-init.sql

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/DynamicAccount.xml
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/DynamicAccount.xml?view=diff&rev=464979&r1=464978&r2=464979
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/DynamicAccount.xml
(original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/DynamicAccount.xml
Tue Oct 17 10:57:27 2006
@@ -1,527 +1,527 @@
-<?xml version="1.0" encoding="utf-8" ?> 
+<?xml version="1.0" encoding="utf-8" ?>
 <sqlMap namespace="Account" 
 xmlns="http://ibatis.apache.org/mapping" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-		
-	<alias>
-		<typeAlias alias="Search" type="IBatisNet.DataMapper.Test.Domain.Search, IBatisNet.DataMapper.Test"/>
-		<typeAlias alias="Query" type="IBatisNet.DataMapper.Test.Domain.Query, IBatisNet.DataMapper.Test"/>
-	</alias>
-			
-	<statements>
-	
-		<statement id="DynamicJIRA168"
+
+  <alias>
+    <typeAlias alias="Search" type="IBatisNet.DataMapper.Test.Domain.Search, IBatisNet.DataMapper.Test"/>
+    <typeAlias alias="Query" type="IBatisNet.DataMapper.Test.Domain.Query, IBatisNet.DataMapper.Test"/>
+  </alias>
+
+  <statements>
+
+    <statement id="DynamicJIRA168"
 					parameterClass="Query"
 					resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			<dynamic prepend="where">
-				<isParameterPresent>
-					<isNotEmpty prepend="and" property="DataObject.Id" >
-					Account_ID = #DataObject.Id#
-					</isNotEmpty>
-					<isNotEmpty prepend="and" property="DataObject.FirstName" >
-					Account_FirstName = #DataObject.FirstName#
-					</isNotEmpty>
-					<isNotEmpty prepend="and" property="DataObject.LastName"  >
-					Account_LastName = #DataObject.LastName#
-					</isNotEmpty>
-				</isParameterPresent>
-			</dynamic>
-		</statement>
-		
-		<!-- IBATISNET-114: remapResults -->
-		<statement  id="DynamicSqlOnColumnSelection" 
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      <dynamic prepend="where">
+        <isParameterPresent>
+          <isNotEmpty prepend="and" property="DataObject.Id" >
+            Account_ID = #DataObject.Id#
+          </isNotEmpty>
+          <isNotEmpty prepend="and" property="DataObject.FirstName" >
+            Account_FirstName = #DataObject.FirstName#
+          </isNotEmpty>
+          <isNotEmpty prepend="and" property="DataObject.LastName"  >
+            Account_LastName = #DataObject.LastName#
+          </isNotEmpty>
+        </isParameterPresent>
+      </dynamic>
+    </statement>
+
+    <!-- IBATISNET-114: remapResults -->
+    <statement  id="DynamicSqlOnColumnSelection" 
 					parameterClass="Account" 
 					resultClass="Account"
 					remapResults="true">
-			SELECT
-			Account_ID as Id,
-			<dynamic>
-				<isEqual property="LastName" compareValue="Dalton" >
-					Account_FirstName as FirstName,
-				</isEqual>
-				<isEqual property="LastName" compareValue="Dalton" >
-					Account_LastName as LastName,
-				</isEqual>
-			</dynamic>
-
-			Account_Email as EmailAddress
-			FROM
-			Accounts
-		</statement>
-		
-		<statement id="DynamicIsEqual"
+      SELECT
+      Account_ID as Id,
+      <dynamic>
+        <isEqual property="LastName" compareValue="Dalton" >
+          Account_FirstName as FirstName,
+        </isEqual>
+        <isEqual property="LastName" compareValue="Dalton" >
+          Account_LastName as LastName,
+        </isEqual>
+      </dynamic>
+
+      Account_Email as EmailAddress
+      FROM
+      Accounts
+    </statement>
+
+    <statement id="DynamicIsEqual"
 				parameterClass="string"
 				resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			<isEqual compareValue="Joe" >
-				where Account_FirstName = 'Joe'
-			</isEqual>
-		</statement>
-		
-		<statement id="DynamicIsParameterPresent"
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      <isEqual compareValue="Joe" >
+        where Account_FirstName = 'Joe'
+      </isEqual>
+    </statement>
+
+    <statement id="DynamicIsParameterPresent"
 				parameterClass="integer"
 				resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			<isParameterPresent >
-			where Account_ID = #value#
-			</isParameterPresent>
-		</statement>
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      <isParameterPresent >
+        where Account_ID = #value#
+      </isParameterPresent>
+    </statement>
 
-		<statement id="DynamicIsNotEmpty"
+    <statement id="DynamicIsNotEmpty"
 					parameterClass="string"
 					resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			<isNotEmpty>
-			where Account_FirstName = #value#
-			</isNotEmpty>
-		</statement>
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      <isNotEmpty>
+        where Account_FirstName = #value#
+      </isNotEmpty>
+    </statement>
 
-		<statement id="DynamicIsGreater"
+    <statement id="DynamicIsGreater"
 					parameterClass="int"
 					resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			<isGreaterThan compareValue="3" >
-			where Account_ID = 1
-			</isGreaterThan>
-		</statement>
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      <isGreaterThan compareValue="3" >
+        where Account_ID = 1
+      </isGreaterThan>
+    </statement>
 
-		<statement id="DynamicIsGreaterEqual"
+    <statement id="DynamicIsGreaterEqual"
 					parameterClass="int"
 					resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			<isGreaterEqual compareValue="3" >
-			where Account_ID = 1
-			</isGreaterEqual>
-		</statement>
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      <isGreaterEqual compareValue="3" >
+        where Account_ID = 1
+      </isGreaterEqual>
+    </statement>
 
-		<statement id="DynamicIsLess"
+    <statement id="DynamicIsLess"
 					parameterClass="int"
 					resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			<isLessThan compareValue="3" >
-			where Account_ID = 1
-			</isLessThan>
-		</statement>
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      <isLessThan compareValue="3" >
+        where Account_ID = 1
+      </isLessThan>
+    </statement>
 
-		<statement id="DynamicIsLessEqual"
+    <statement id="DynamicIsLessEqual"
 					parameterClass="int"
 					resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			<isLessEqual compareValue="3" >
-			where Account_ID = 1
-			</isLessEqual>
-		</statement>
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      <isLessEqual compareValue="3" >
+        where Account_ID = 1
+      </isLessEqual>
+    </statement>
 
-		<statement id="DynamicIsNotNull"
+    <statement id="DynamicIsNotNull"
 					parameterClass="string"
 					resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			<isNotNull>
-			where Account_ID = 1
-			</isNotNull>
-		</statement>
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      <isNotNull>
+        where Account_ID = 1
+      </isNotNull>
+    </statement>
 
-		<statement id="DynamicIsPropertyAvailable"
+    <statement id="DynamicIsPropertyAvailable"
 					parameterClass="string"
 					resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			<isPropertyAvailable property="Id" >
-			where Account_ID = 1
-			</isPropertyAvailable>
-		</statement>
-	
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      <isPropertyAvailable property="Id" >
+        where Account_ID = 1
+      </isPropertyAvailable>
+    </statement>
 
-		<statement id="DynamicSubst"
+
+    <statement id="DynamicSubst"
 					parameterClass="map"
 					resultClass="Account">
-			<dynamic>
-			$statement$
-			</dynamic>
-		</statement>
+      <dynamic>
+        $statement$
+      </dynamic>
+    </statement>
 
-		<statement id="DynamicIterate"
+    <statement id="DynamicIterate"
 					parameterClass="list"
 					resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			WHERE Account_ID IN
-			<iterate open="(" close=")" conjunction=",">
-				#[]#
-			</iterate>
-		</statement>
-		
-		<statement id="DynamicIterate2"
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      WHERE Account_ID IN
+      <iterate open="(" close=")" conjunction=",">
+        #[]#
+      </iterate>
+    </statement>
+
+    <statement id="DynamicIterate2"
 					parameterClass="Account"
 					resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			WHERE Account_ID IN
-			<iterate property="Ids" open="(" close=")"  conjunction="," >
-				#Ids[]#
-			</iterate>
-		</statement>
-		
-		 <statement id="MultiDynamicIterate"
-             parameterClass="list"
-             resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			WHERE Account_ID IN
-			<iterate open="(" close=")" conjunction=",">
-				#[]#
-			</iterate>
-				and Account_ID IN
-			<iterate open="(" close=")" conjunction=",">
-				#[]#
-			</iterate>
-		</statement>
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      WHERE Account_ID IN
+      <iterate property="Ids" open="(" close=")"  conjunction="," >
+        #Ids[]#
+      </iterate>
+    </statement>
+
+    <statement id="MultiDynamicIterate"
+            parameterClass="list"
+            resultClass="Account">
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      WHERE Account_ID IN
+      <iterate open="(" close=")" conjunction=",">
+        #[]#
+      </iterate>
+      and Account_ID IN
+      <iterate open="(" close=")" conjunction=",">
+        #[]#
+      </iterate>
+    </statement>
 
-		<select  id="DynamicAll"
+    <select  id="DynamicAll"
 					parameterClass="Account"
 					resultClass="Account">
-				select
-				Account_ID			as Id,
-				Account_FirstName	as FirstName,
-				Account_LastName	as LastName,
-				Account_Email		as EmailAddress
-				from Accounts
-		</select>
-		
-		<statement id="DynamicQueryByExample"
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+    </select>
+
+    <statement id="DynamicQueryByExample"
 					parameterClass="Account"
 					resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			<dynamic prepend="WHERE" >
-			<isGreaterThan prepend="AND" property="Id" compareValue="0"  >
-				Account_ID = #Id#
-			</isGreaterThan>
-			<isNotNull prepend="AND" property="Ids" >
-				Account_ID in
-				<iterate property="Ids" open="(" close=")"  conjunction="," >
-					#Ids[]#
-				</iterate>
-			</isNotNull>
-			<isNotEmpty prepend="AND" property="FirstName" >
-				Account_FirstName = #FirstName#
-			</isNotEmpty>
-			<isNotEmpty prepend="AND" property="LastName" >
-				Account_LastName = #LastName#
-			</isNotEmpty>
-			<isNotEmpty prepend="AND" property="EmailAddress" >
-				<isEqual property="EmailAddress" compareValue="Joe">
-				Account_Email = 'clinton.begin@ibatis.com'
-				</isEqual>
-				<isNotEqual property="EmailAddress" compareValue="Joe">
-				Account_Email = #EmailAddress#
-				</isNotEqual>
-			</isNotEmpty>
-			</dynamic>
-		</statement>
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      <dynamic prepend="WHERE" >
+        <isGreaterThan prepend="AND" property="Id" compareValue="0"  >
+          Account_ID = #Id#
+        </isGreaterThan>
+        <isNotNull prepend="AND" property="Ids" >
+          Account_ID in
+          <iterate property="Ids" open="(" close=")"  conjunction="," >
+            #Ids[]#
+          </iterate>
+        </isNotNull>
+        <isNotEmpty prepend="AND" property="FirstName" >
+          Account_FirstName = #FirstName#
+        </isNotEmpty>
+        <isNotEmpty prepend="AND" property="LastName" >
+          Account_LastName = #LastName#
+        </isNotEmpty>
+        <isNotEmpty prepend="AND" property="EmailAddress" >
+          <isEqual property="EmailAddress" compareValue="gilles">
+            Account_Email = 'gilles.bayon@nospam.org'
+          </isEqual>
+          <isNotEqual property="EmailAddress" compareValue="gilles">
+            Account_Email = #EmailAddress#
+          </isNotEqual>
+        </isNotEmpty>
+      </dynamic>
+    </statement>
 
-		<statement id="DynamicQueryByExampleViaPrivateField"
+    <statement id="DynamicQueryByExampleViaPrivateField"
 					parameterClass="Account"
 					resultClass="Account">
-			select
-			Account_ID			as id,
-			Account_FirstName	as _firstName,
-			Account_LastName	as _lastName,
-			Account_Email		as _emailAddress
-			from Accounts
-			<dynamic prepend="WHERE" >
-			<isGreaterThan prepend="AND" property="id" compareValue="0"  >
-				Account_ID = #id#
-			</isGreaterThan>
-			<isNotNull prepend="AND" property="Ids" >
-				Account_ID in
-				<iterate property="_ids" open="(" close=")"  conjunction="," >
-					#_ids[]#
-				</iterate>
-			</isNotNull>
-			<isNotEmpty prepend="AND" property="_firstName" >
-				Account_FirstName = #FirstName#
-			</isNotEmpty>
-			<isNotEmpty prepend="AND" property="_lastName" >
-				Account_LastName = #LastName#
-			</isNotEmpty>
-			<isNotEmpty prepend="AND" property="EmailAddress" >
-				<isEqual property="_emailAddress" compareValue="Joe">
-				Account_Email = 'clinton.begin@ibatis.com'
-				</isEqual>
-				<isNotEqual property="_emailAddress" compareValue="Joe">
-				Account_Email = #_emailAddress#
-				</isNotEqual>
-			</isNotEmpty>
-			</dynamic>
-		</statement>
-		
-		<select id="DynamicWithExtend"
+      select
+      Account_ID			as id,
+      Account_FirstName	as _firstName,
+      Account_LastName	as _lastName,
+      Account_Email		as _emailAddress
+      from Accounts
+      <dynamic prepend="WHERE" >
+        <isGreaterThan prepend="AND" property="id" compareValue="0"  >
+          Account_ID = #id#
+        </isGreaterThan>
+        <isNotNull prepend="AND" property="Ids" >
+          Account_ID in
+          <iterate property="_ids" open="(" close=")"  conjunction="," >
+            #_ids[]#
+          </iterate>
+        </isNotNull>
+        <isNotEmpty prepend="AND" property="_firstName" >
+          Account_FirstName = #FirstName#
+        </isNotEmpty>
+        <isNotEmpty prepend="AND" property="_lastName" >
+          Account_LastName = #LastName#
+        </isNotEmpty>
+        <isNotEmpty prepend="AND" property="EmailAddress" >
+          <isEqual property="_emailAddress" compareValue="gilles">
+            Account_Email = 'gilles.bayon@nospam.org'
+          </isEqual>
+          <isNotEqual property="_emailAddress" compareValue="gilles">
+            Account_Email = #_emailAddress#
+          </isNotEqual>
+        </isNotEmpty>
+      </dynamic>
+    </statement>
+
+    <select id="DynamicWithExtend"
 				extends="DynamicAll"
 				parameterClass="Account"
 				resultClass="Account">
-			<dynamic prepend="WHERE" >
-			<isGreaterThan prepend="AND" property="Id" compareValue="0"  >
-				Account_ID = #Id#
-			</isGreaterThan>
-			<isNotNull prepend="AND" property="Ids" >
-				Account_ID in
-				<iterate property="Ids" open="(" close=")"  conjunction="," >
-					#Ids[]#
-				</iterate>
-			</isNotNull>
-			<isNotEmpty prepend="AND" property="FirstName" >
-				Account_FirstName = #FirstName#
-			</isNotEmpty>
-			<isNotEmpty prepend="AND" property="LastName" >
-				Account_LastName = #LastName#
-			</isNotEmpty>
-			<isNotEmpty prepend="AND" property="EmailAddress" >
-				<isEqual property="EmailAddress" compareValue="Joe">
-				Account_Email = 'clinton.begin@ibatis.com'
-				</isEqual>
-				<isNotEqual property="EmailAddress" compareValue="Joe">
-				Account_Email = #EmailAddress#
-				</isNotEqual>
-			</isNotEmpty>
-			</dynamic>
-		</select>
-		
-		<statement id="DynamicIterateWithPrepend1"
+      <dynamic prepend="WHERE" >
+        <isGreaterThan prepend="AND" property="Id" compareValue="0"  >
+          Account_ID = #Id#
+        </isGreaterThan>
+        <isNotNull prepend="AND" property="Ids" >
+          Account_ID in
+          <iterate property="Ids" open="(" close=")"  conjunction="," >
+            #Ids[]#
+          </iterate>
+        </isNotNull>
+        <isNotEmpty prepend="AND" property="FirstName" >
+          Account_FirstName = #FirstName#
+        </isNotEmpty>
+        <isNotEmpty prepend="AND" property="LastName" >
+          Account_LastName = #LastName#
+        </isNotEmpty>
+        <isNotEmpty prepend="AND" property="EmailAddress" >
+          <isEqual property="EmailAddress" compareValue="Joe">
+            Account_Email = 'clinton.begin@ibatis.com'
+          </isEqual>
+          <isNotEqual property="EmailAddress" compareValue="Joe">
+            Account_Email = #EmailAddress#
+          </isNotEqual>
+        </isNotEmpty>
+      </dynamic>
+    </select>
+
+    <statement id="DynamicIterateWithPrepend1"
 					parameterClass="list"
 					resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			<dynamic prepend="where" >
-			Account_ID IN
-			<iterate open="(" close=")" conjunction=",">
-				#[]#
-			</iterate>
-			</dynamic>
-		</statement>	
-		
-		<statement id="DynamicIterateWithPrepend2"
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      <dynamic prepend="where" >
+        Account_ID IN
+        <iterate open="(" close=")" conjunction=",">
+          #[]#
+        </iterate>
+      </dynamic>
+    </statement>
+
+    <statement id="DynamicIterateWithPrepend2"
 					parameterClass="list"
 					resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			<dynamic prepend="where" >
-			<iterate open="(" close=")" conjunction="OR">
-				Account_ID = #[]#
-			</iterate>
-			</dynamic>
-		</statement>
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      <dynamic prepend="where" >
+        <iterate open="(" close=")" conjunction="OR">
+          Account_ID = #[]#
+        </iterate>
+      </dynamic>
+    </statement>
 
-		<statement id="DynamicIterateWithPrepend3"
+    <statement id="DynamicIterateWithPrepend3"
 					parameterClass="list"
 					resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			<dynamic prepend="where" >
-				<isParameterPresent prepend="BLAH!" >
-					<iterate open="(" close=")" conjunction="OR">
-						Account_ID = #[]#
-					</iterate>
-				</isParameterPresent>
-			</dynamic>
-		</statement>
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      <dynamic prepend="where" >
+        <isParameterPresent prepend="BLAH!" >
+          <iterate open="(" close=")" conjunction="OR">
+            Account_ID = #[]#
+          </iterate>
+        </isParameterPresent>
+      </dynamic>
+    </statement>
 
-		<statement id="DynamicWithPrepend"
+    <statement id="DynamicWithPrepend"
 					parameterClass="Account"
 					resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			<dynamic prepend="where">
-				<isParameterPresent>
-					<isNotEmpty prepend="and" property="Id" >
-					Account_ID = #Id#
-					</isNotEmpty>
-					<isNotEmpty prepend="and" property="FirstName" >
-					Account_FirstName = #FirstName#
-					</isNotEmpty>
-					<isNotEmpty prepend="and" property="LastName"  >
-					Account_LastName = #LastName#
-					</isNotEmpty>
-				</isParameterPresent>
-			</dynamic>
-		</statement>
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      <dynamic prepend="where">
+        <isParameterPresent>
+          <isNotEmpty prepend="and" property="Id" >
+            Account_ID = #Id#
+          </isNotEmpty>
+          <isNotEmpty prepend="and" property="FirstName" >
+            Account_FirstName = #FirstName#
+          </isNotEmpty>
+          <isNotEmpty prepend="and" property="LastName"  >
+            Account_LastName = #LastName#
+          </isNotEmpty>
+        </isParameterPresent>
+      </dynamic>
+    </statement>
 
-		<statement id="DynamicWithTwoDynamicElements"
+    <statement id="DynamicWithTwoDynamicElements"
              parameterClass="Account"
              resultClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			<dynamic prepend="where">
-				<isNotEmpty prepend="BLAH!" property="Id" >
-				Account_ID = #Id#
-				</isNotEmpty>
-			</dynamic>
-			<dynamic prepend="and">
-				<isNotEmpty prepend="BLAH!" property="FirstName" >
-				Account_FirstName = #FirstName#
-				</isNotEmpty>
-				<isNotEmpty prepend="and" property="LastName"  >
-				Account_LastName = #LastName#
-				</isNotEmpty>
-			</dynamic>
-		</statement>
-  
-		<statement id="ComplexDynamicStatement" 
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      <dynamic prepend="where">
+        <isNotEmpty prepend="BLAH!" property="Id" >
+          Account_ID = #Id#
+        </isNotEmpty>
+      </dynamic>
+      <dynamic prepend="and">
+        <isNotEmpty prepend="BLAH!" property="FirstName" >
+          Account_FirstName = #FirstName#
+        </isNotEmpty>
+        <isNotEmpty prepend="and" property="LastName"  >
+          Account_LastName = #LastName#
+        </isNotEmpty>
+      </dynamic>
+    </statement>
+
+    <statement id="ComplexDynamicStatement" 
 			cacheModel="account-cache" 
 			resultClass="Account" 
 			parameterClass="Account">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			<dynamic prepend="WHERE">
-				<isNotNull prepend="AND" property="FirstName">
-					(Account_FirstName = #FirstName#
-					<isNotNull prepend="OR" property="LastName">
-					Account_LastName = #LastName#
-					</isNotNull>
-					)
-				</isNotNull>
-				<isNotNull prepend="AND" property="EmailAddress">
-					Account_Email like #EmailAddress#
-				</isNotNull>
-				<isGreaterThan prepend="AND" property="Id" compareValue="0">
-					Account_ID = #Id#
-				</isGreaterThan>
-			</dynamic>
-			order by Account_LastName
-		</statement>
-			
-		<statement id="Jira-IBATISNET-11" 
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      <dynamic prepend="WHERE">
+        <isNotNull prepend="AND" property="FirstName">
+          (Account_FirstName = #FirstName#
+          <isNotNull prepend="OR" property="LastName">
+            Account_LastName = #LastName#
+          </isNotNull>
+          )
+        </isNotNull>
+        <isNotNull prepend="AND" property="EmailAddress">
+          Account_Email like #EmailAddress#
+        </isNotNull>
+        <isGreaterThan prepend="AND" property="Id" compareValue="0">
+          Account_ID = #Id#
+        </isGreaterThan>
+      </dynamic>
+      order by Account_LastName
+    </statement>
+
+    <statement id="Jira-IBATISNET-11" 
 			resultClass="Account" 
 			parameterClass="Search">
-			select
-			Account_ID			as Id,
-			Account_FirstName	as FirstName,
-			Account_LastName	as LastName,
-			Account_Email		as EmailAddress
-			from Accounts
-			<dynamic prepend="where">
-				<isNotNull prepend="and" property="NumberSearch">
-					((Account_ID $Operande$ #NumberSearch#) or 
-					(Account_ID $Operande$ #NumberSearch#)) 
-				</isNotNull>
-				<isEqual prepend="and" property="StartDate" compareValue="25/12/2004">
-						<![CDATA[Account_FirstName >= #Operande# ]]>
-				</isEqual>
-				<isEqual prepend="and" property="StartDateAnd" compareValue="true">
-						<![CDATA[Account_LastName >= #Operande# ]]>
-				</isEqual>
-			</dynamic>
-
-			order by Account_LastName
-		</statement>
-		
-				<insert id="SelectKeyWithDynamicSql">
-			INSERT INTO $AccountsTableName$
-			(
-				Account_ID, 
-				Account_FirstName,
-				Account_LastName
-			) 
-			VALUES 
-			(
-				#Account.Id#, 
-				#Account.FirstName#,
-				#Account.LastName#
-			)
-			<selectKey property="AccountId" type="post" resultClass="int">
-				SELECT Account_ID FROM $AccountsTableName$ WHERE Account_ID = #Account.Id#
-			</selectKey>			
-		</insert>
-		
-	</statements>
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      <dynamic prepend="where">
+        <isNotNull prepend="and" property="NumberSearch">
+          ((Account_ID $Operande$ #NumberSearch#) or
+          (Account_ID $Operande$ #NumberSearch#))
+        </isNotNull>
+        <isEqual prepend="and" property="StartDate" compareValue="25/12/2004">
+          <![CDATA[Account_FirstName >= #Operande# ]]>
+        </isEqual>
+        <isEqual prepend="and" property="StartDateAnd" compareValue="true">
+          <![CDATA[Account_LastName >= #Operande# ]]>
+        </isEqual>
+      </dynamic>
+
+      order by Account_LastName
+    </statement>
+
+    <insert id="SelectKeyWithDynamicSql">
+      INSERT INTO $AccountsTableName$
+      (
+      Account_ID,
+      Account_FirstName,
+      Account_LastName
+      )
+      VALUES
+      (
+      #Account.Id#,
+      #Account.FirstName#,
+      #Account.LastName#
+      )
+      <selectKey property="AccountId" type="post" resultClass="int">
+        SELECT Account_ID FROM $AccountsTableName$ WHERE Account_ID = #Account.Id#
+      </selectKey>
+    </insert>
+
+  </statements>
 </sqlMap>

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/account-init.sql
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/account-init.sql?view=diff&rev=464979&r1=464978&r2=464979
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/account-init.sql (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/account-init.sql Tue Oct
17 10:57:27 2006
@@ -31,7 +31,7 @@
 INSERT INTO [dbo].[Accounts] VALUES(2,'Averel', 'Dalton', 'Averel.Dalton@somewhere.com',
'Oui', 200);
 INSERT INTO [dbo].[Accounts] VALUES(3,'William', 'Dalton', null, 'Non', 100);
 INSERT INTO [dbo].[Accounts] VALUES(4,'Jack', 'Dalton', 'Jack.Dalton@somewhere.com', 'Non',
100);
-INSERT INTO [dbo].[Accounts] VALUES(5,'Gilles', 'Bayon', null, 'Oui', 100);
+INSERT INTO [dbo].[Accounts] VALUES(5,'Gilles', 'Bayon', 'gilles.bayon@nospam.org', 'Oui',
100);
 
 -- Store procedure
 

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/order-init.sql
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/order-init.sql?view=diff&rev=464979&r1=464978&r2=464979
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/order-init.sql (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/order-init.sql Tue Oct
17 10:57:27 2006
@@ -50,5 +50,5 @@
 INSERT INTO [dbo].[Orders] VALUES (8, 3, '2003-02-15 8:15:00', 'AMEX', '777777777777', '12/03',
'888 Our Street', 'Regina', 'SK', 'S4S 7G4',1);
 INSERT INTO [dbo].[Orders] VALUES (9, 2, '2003-02-15 8:15:00', 'MC', '666666666666', '01/04',
'999 Your Street', 'Toronto', 'ON', 'G4D 9F4',2);
 INSERT INTO [dbo].[Orders] VALUES (10, 1, '2003-02-15 8:15:00', 'VISA', '555555555555', '02/04',
'99 Some Street', 'Calgary', 'AB', 'W4G 7A4',1);
-INSERT INTO [dbo].[Orders] VALUES (11, null, '2003-02-15 8:15:00', 'VISA', '555555555555',
'02/04', 'Null order', 'Calgary', 'ZZ', 'XXX YYY',1);
+INSERT INTO [dbo].[Orders] VALUES (11, null, '2003-02-17 8:15:00', 'VISA', '555555555555',
'02/04', 'Null order', 'Calgary', 'ZZ', 'XXX YYY',1);
 



Mime
View raw message