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/05/15 20:12:51 UTC
svn commit: r170241 -
/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP
/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MySql
/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Oracle
/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug
/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements
Author: roberto
Date: Sun May 15 11:12:50 2005
New Revision: 170241
URL: http://svn.apache.org/viewcvs?rev=170241&view=rev
Log:
~Updated C# DataMapper for JIRA 30 and ODP.NET: providers.config, PreparedStatementFactory.cs, and Account.xml
~Updated C# DataMapper NUnit MySql and Oracle DataBase.sql scripts
Modified:
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Account.xml
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MySql/DataBase.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Oracle/DataBase.sql
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config
incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements/PreparedStatementFactory.cs
Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Account.xml
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Account.xml?rev=170241&r1=170240&r2=170241&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Account.xml (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Account.xml Sun May 15 11:12:50 2005
@@ -518,6 +518,9 @@
</isNotEmpty>
</select>
+ <!--
+ Using positional parameters with a parameterClass or parameterMap
+ -->
<select id="GetAccountWithRepeatingProperty"
parameterClass="Account"
resultMap="account-result">
@@ -533,6 +536,23 @@
Account_LastName = #LastName# and
Account_ID = #Id#
</select>
+ <!--
+ <select id="GetAccountWithRepeatingProperty"
+ parameterMap="account-repeat-param"
+ resultMap="account-result">
+ select
+ Account_ID,
+ Account_FirstName,
+ Account_LastName,
+ Account_Email
+ from Accounts
+ where Account_ID = ? and
+ Account_ID = ? and
+ Account_FirstName = ? and
+ Account_LastName = ? and
+ Account_ID = ?
+ </select>
+ -->
<!-- For procedure, the parameters of the parameterMap must in the same order
as for the procedure paramaters-->
@@ -611,6 +631,14 @@
<parameter property="EmailAddress" dbType="VarChar2" size="128" nullValue="no_email@provided.com"/>
<parameter property="Id" dbType="Int32"/>
</parameterMap>
+
+ <parameterMap id="account-repeat-param">
+ <parameter property="Id" dbType="Int32"/>
+ <parameter property="Id" dbType="Int32"/>
+ <parameter property="FirstName" dbType="VarChar2" size="32"/>
+ <parameter property="LastName" dbType="VarChar2" size="32"/>
+ <parameter property="Id" dbType="Int32"/>
+ </parameterMap>
</parameterMaps>
Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MySql/DataBase.sql
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MySql/DataBase.sql?rev=170241&r1=170240&r2=170241&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MySql/DataBase.sql (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MySql/DataBase.sql Sun May 15 11:12:50 2005
@@ -112,7 +112,8 @@
(
Other_Int int,
Other_Long bigint,
- Other_Bit bit not null default 0
+ Other_Bit bit not null default 0,
+ Other_String varchar(32) not null
) TYPE=INNODB;
/*==============================================================*/
Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Oracle/DataBase.sql
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Oracle/DataBase.sql?rev=170241&r1=170240&r2=170241&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Oracle/DataBase.sql (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/Oracle/DataBase.sql Sun May 15 11:12:50 2005
@@ -124,7 +124,8 @@
CREATE TABLE OTHERS (
OTHER_INT INT NULL ,
OTHER_LONG INT NULL ,
- OTHER_BIT SMALLINT DEFAULT 0 NOT NULL
+ OTHER_BIT SMALLINT DEFAULT 0 NOT NULL,
+ OTHER_STRING VARCHAR2(32) NOT NULL
)
NOLOGGING
NOCACHE
Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config?rev=170241&r1=170240&r2=170241&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config Sun May 15 11:12:50 2005
@@ -100,16 +100,16 @@
parameterDbTypeProperty="OracleDbType"
dataAdapterClass="Oracle.DataAccess.Client.OracleDataAdapter"
commandBuilderClass="Oracle.DataAccess.Client.OracleCommandBuilder"
- usePositionalParameters = "false"
+ usePositionalParameters = "true"
useParameterPrefixInSql = "true"
- useParameterPrefixInParameter = "false"
+ useParameterPrefixInParameter = "true"
parameterPrefix=":"
useDeriveParameters="false"
/>
<provider
name="oracleClient1.0"
description="Oracle, Microsoft provider V1.0.5000.0"
- enabled="true"
+ enabled="false"
default="false"
assemblyName="System.Data.OracleClient, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
connectionClass="System.Data.OracleClient.OracleConnection"
@@ -127,7 +127,7 @@
<provider
name="ByteFx"
description="MySQL, ByteFx provider V0.7.6.15073"
- enabled="true"
+ enabled="false"
assemblyName="ByteFX.MySqlClient, Version=0.7.6.15073, Culture=neutral, PublicKeyToken=f2fef6fed1732fc1"
connectionClass="ByteFX.Data.MySqlClient.MySqlConnection"
commandClass="ByteFX.Data.MySqlClient.MySqlCommand"
Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements/PreparedStatementFactory.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements/PreparedStatementFactory.cs?rev=170241&r1=170240&r2=170241&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements/PreparedStatementFactory.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements/PreparedStatementFactory.cs Sun May 15 11:12:50 2005
@@ -375,8 +375,19 @@
if (_session.DataSource.Provider.UsePositionalParameters)
{
- // OLEDB/OBDC doesn't support named parameters !!!
- sqlParamName = "?";
+ // TODO Refactor?
+ if (_parameterPrefix.Equals(":"))
+ {
+ // ODP.NET uses positional parameters by default
+ // but uses ":0" or ":1" instead of "?"
+ sqlParamName = ":" + index;
+ }
+ else
+ {
+ // OLEDB/OBDC doesn't support named parameters !!!
+ sqlParamName = "?";
+ }
+
}
else
{