You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Roberto Rabe (JIRA)" <ib...@incubator.apache.org> on 2005/05/06 15:44:07 UTC

[jira] Resolved: (IBATISNET-27) Oracle Issues

     [ http://issues.apache.org/jira/browse/IBATISNET-27?page=all ]
     
Roberto Rabe resolved IBATISNET-27:
-----------------------------------

     Resolution: Fixed
    Fix Version: DataMapper 1.2

Changes are in SVN.

> Oracle Issues
> -------------
>
>          Key: IBATISNET-27
>          URL: http://issues.apache.org/jira/browse/IBATISNET-27
>      Project: iBatis for .NET
>         Type: Improvement
>  Environment: vs 2003. Oracle 9i
>     Reporter: Ryan Yao
>     Assignee: Roberto Rabe
>      Fix For: DataMapper 1.2

>
> Thank you guys hard working on iBatis, I really like it. 
> There are some issues I found in DataMapper
> 1: Oracle has limitation on any parameter names. Let's say, if you have an object property like:
> Customer.Address.ProvinceOrState.Country.Id, then your sqlParamName will be 
> :Customer_Address_ProvinceOrState_Country_Id  
> Oracle doesn't like parameter longer than 30 characters.
> So what I can do is:
> public class PreparedStatementFactory
> .....
> private void CreateParametersForStatementText()
> ...
> change 
> sqlParamName = _parameterPrefix + paramName;}
> to something like:
> if (_session.DataSource.Provider.Name.Substring(0,6).ToLower().Equals("oracle"))
> {sqlParamName = _parameterPrefix + "param" + v_i;}
> else
> {sqlParamName = _parameterPrefix + paramName;}
> so the parameters to ":param0,:param2......".
> There probably there are better ways to solve this, this is the way I am using for now.
> 2. Oracle data adapter does not take empty string(it will throw exceptions if you do so), it takes Null/Nothing or strings(but no string.empty or "").So, in 
> public class ParameterMap
> .....
> public object GetValueOfProperty(object source, string propertyName)
> ......
> after
> if (propertyValue == null)
> {
> 	propertyValue = DBNull.Value; ;
> }
> Added:
> else if (propertyValue.GetType() == typeof(string) && propertyValue.ToString() == "" )
> {
>         //Manually changed "" to DbNull
> 	propertyValue = DBNull.Value;
> }
> Thanks....

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira