You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Michael Schall (JIRA)" <ib...@incubator.apache.org> on 2006/03/01 05:37:41 UTC

[jira] Commented: (IBATISNET-137) TypeHandlers for "System.Nullable(Of" fails with custom types

    [ http://issues.apache.org/jira/browse/IBATISNET-137?page=comments#action_12368217 ] 

Michael Schall commented on IBATISNET-137:
------------------------------------------

What do you mean that the type definition is invalid?  

For built in types a type string of System.Nullable`1[[System.Datetime]] will work fine since the framework knows how to load the code. The type I would like to define is System.Nullable of a custom structure.  The structure is ATG.Money and it is in the ATG.Money dll.  Since it is not a built-in type you have to give it a more quilified name(AssemblyQualifiedName) so it can find the correct code.  The AssemblyQualifiedName uses a comma to separate the class name from the assembly name.  The code in SplitTypeAndAssemblyNames does not work for nested types like generics due to the way it splits the string.  It looks for the class System.Nullable`1[[ATG.Money in the dll ATG.Money]]

Am I missing something?



> TypeHandlers for "System.Nullable(Of" fails with custom types
> -------------------------------------------------------------
>
>          Key: IBATISNET-137
>          URL: http://issues.apache.org/jira/browse/IBATISNET-137
>      Project: iBatis for .NET
>         Type: Bug
>   Components: DataMapper
>     Versions: DataMapper 1.2.1
>     Reporter: Michael Schall

>
> <typeHandler
>      type="System.Nullable`1[[ATG.Money, ATG.Money]]" dbType="Currency" callback="ATG.Database.TypeHandlers.NullableMoneyTypeHandlerCallback, ATG.Database"/>
> This fails inside the function SplitTypeAndAssemblyNames.  The function
> simply splits on the ',' to find the dll to load.  If I change this
> function to check if it is a generic type string it works fine.
>      if (typeAssemblyIndex < 0 || originalTypeName.Contains("`1[["))

-- 
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