That’s right the default one is being called.  No, I haven’t left the jdbtype off because I don’t want all byte[] to be saved this way.  I guess I could try that.

 

It seems since the default one is being called that maybe the way the handler is looked up is not working how I would expect.  I expect a more fine-grained type mapping to take precedence over a broader one.

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 19, 2006 12:31 PM
To: March, Andres; dev@ibatis.apache.org
Subject: Re: specify typehandler for byte[]

 

You are correct the CTH's are keep in a Map<classType, <jdbcType, CTH>>

 

Hope you understand that :)

 

here is what is registered by default....

 

register(byte[].class, new ByteArrayTypeHandler());

register(byte[].class, "BLOB", new CustomTypeHandler(new BlobTypeHandlerCallback()));

register(byte[].class, "LONGVARBINARY", new CustomTypeHandler(new BlobTypeHandlerCallback()));

 

 

To me it looks like the first is getting called for you.  Have you tried to leave the jdbcType attribute out of you CTH definition?

 

Nathan

 

On Jan 19, 2006, at 1:15 PM, March, Andres wrote:



ASFAIK, the jdbc type should match the jdbc type in the sqlmap.  That is how the type handler is called.  The db type is NUMERIC and the cal is actually setBigDecimal() as the type handler’s name infers.

 

My understanding is that the type handler would be put in a table keyed off of java and jdbc type and when the sql map matches it invokes the type handler. No?

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 19, 2006 12:12 PM
To: March, Andres
Subject: Re: specify typehandler for byte[]

 

Actually I don't think that will work either.

 

"[B"  should be correct.

 

Are you sure that the JDBC type is NUMERIC? and not something more specific?

 

Nathan

 

 

On Jan 19, 2006, at 1:00 PM, March, Andres wrote:




 

 

This is the javaType that works in the sqlmap but not in the sqlconfig –  

typeHandler jdbcType==Platform - Apps Engineering

 

 

 

 

Reply via email to