You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Niels Beekman <n....@wis.nl> on 2006/10/11 00:51:25 UTC

RE: Enum typeHandlerCallback

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