ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Beekman" <n.beek...@wis.nl>
Subject RE: Enum typeHandlerCallback
Date Tue, 10 Oct 2006 22:51:25 GMT
You can't start an enum using Class.forName(), so iBATIS can't either.
Afaik you can only use the typehandler by specifying it explictily
inside a (inline) parameterMap or resultMap.

 

Niels

 

________________________________

From: Christopher.Mathrusse@sybase.com
[mailto:Christopher.Mathrusse@sybase.com] 
Sent: woensdag 11 oktober 2006 0:33
To: user-java@ibatis.apache.org
Subject: Enum typeHandlerCallback

 

I'm attempting to implement a TypeHandlerCallback to handle an Enum. The
Enum is declared within a class but I can't seem to figure out how to do
this correctly. I keep getting an exception thrown at startup because
iBatis cannot seem to load the enum. In the Resources class, the method
classForName(String) keeps throwing an exception based upon the javaType
that I have specified in my config file.

 

SqlMapConfig Type Handler declaration:

<typeHandler javaType="com.sybase.cosmos.domain.DocumentStore.State"
callback="com.sybase.cosmos.dao.impl.ibatis.extentions.DocStoreStateType
HandlerCallback" />

Enum defined in java class:

public class DocumentStore extends DomainObject {

public static enum State { INITIALIZED, PROCESSING, COMPLETE, ERROR }

The following in Resources.classForName(String), which is using the
class loader, cannot locate the enum that I have specified.  So how can
I tell iBatis to use my TypeHandlerCallback for this enum?

 

Thanks....

 

Chris Mathrusse

christopher.mathrusse@sybase.com

(925) 236-5553

 


Mime
View raw message