Hi,

could you just try converting Curreny to simple class (temporarly) and
see what happens. Maybe it's an enum issue? I am using type handlers
with classes, didn't try it on enums. Also, make sure the enum full name
is correct, dll name is correct and enum is public. 

This kind of message usually indicates wrong path or "strange behaviour"
;)

Cheers.

-----Original Message-----
From: DaiMichael [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 10, 2008 7:09 PM
To: [email protected]
Subject: Enum TypeHandlers issues...


Hi,

Having a few problems with converting our enums to varchars (it works
one
way (i.e. getting it back from db if i directly ref it on the resultmap)
but
not putting into the db), this is a legacy db so can't change the way it
works (hence using iBatis).

        <alias>
                <typeAlias alias="Currency"
type="Research.Indices.Domain.Enums.Currency,
Research.Indices"/>
                <typeAlias alias="CurrencyTypeHandler"
type="Research.Indices.DataAccess.TypeHandlers.CurrencyTypeHandler,
Research.Indices"/>
                <typeAlias alias="DecimalTypeHandler"
type="Research.Indices.DataAccess.TypeHandlers.DecimalTypeHandler,
Research.Indices"/>
        </alias>  
        <typeHandlers>
                <typeHandler type="Currency" dbType="varchar"
callback="CurrencyTypeHandler"/>
                <typeHandler type="decimal"
callback="DecimalTypeHandler"/>
        </typeHandlers>

It is picking up the DecimalTypeHandler as I have turned logging on (and
shows it overrides it) but when i put in my Currency/CurrencyTypeHandler
i
get errors on xml validation, this makes me feel that the alias hasn't
worked as it can't load the type 'Currency' (which is an enum, just to
be
clear) ...hmmmm... 

using 1.6.1, connecting to mssql 2000, provider sqlserver2.0

any idea's what is going on ? cheers for any replies !
-------- Error

IBatisNet.Common.Exceptions.ConfigurationException: 
- The error occurred while loading typeHandler.

at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument
document, DataSource dataSource, Boolean useConfigFileWatcher, Boolean
isCallFromDao) 
at
IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Configure(XmlDocumen
t
document) 
at
Research.Indices.DataAccess.DataSource.IbatisIndexDBContext.initMapper()
in IbatisIndexDBContext.cs:line 28 
at Research.Indices.DataAccess.DataSource.IbatisIndexDBContext.Get() in
IbatisIndexDBContext.cs:line 39 
at
Research.Indices.DataAccess.DataSource.IbatisDataSource.Get[T](ICommand
command) in IbatisDataSource.cs:line 11 
at
Research.Indices.Test.DataAccess.DataSource.IbatisFxRateTests.IBatisData
SourceCanLoadFxRateById()
in IbatisFxRateTests.cs:line 22 

IBatisNet.Common.Exceptions.ConfigurationException: Error registering
TypeHandler class "CurrencyTypeHandler" for handling .Net type
"Currency"
and dbType "varchar". Cause: Could not load type from string value
'Currency'.

at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Initialize() 
at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Build(XmlDocument
document, DataSource dataSource, Boolean useConfigFileWatcher, Boolean
isCallFromDao) 

System.TypeLoadException: Could not load type from string value
'Currency'.

at
IBatisNet.Common.Utilities.TypesResolver.TypeResolver.ResolveType(String
typeName) 
at IBatisNet.Common.Utilities.TypesResolver.TypeResolver.Resolve(String
typeName) 
at
IBatisNet.Common.Utilities.TypesResolver.CachedTypeResolver.Resolve(Stri
ng
typeName) 
at IBatisNet.Common.Utilities.TypeUtils.ResolveType(String typeName) 
at
IBatisNet.DataMapper.Configuration.Serializers.TypeHandlerDeSerializer.D
eserialize(XmlNode
node, ConfigurationScope configScope) 
at IBatisNet.DataMapper.Configuration.DomSqlMapBuilder.Initialize() 

-- 
View this message in context:
http://www.nabble.com/Enum-TypeHandlers-issues...-tp19415050p19415050.ht
ml
Sent from the iBATIS - User - Cs mailing list archive at Nabble.com.

Reply via email to