Never seen that syntax before.  I can give that a try but my interest is only in rooting out a possible bug.  I don’t use byte[] for this purpose anymore, so I don’t use the type handler.  I would have to build a test case, since my app doesn’t write in this manner anymore.  Might have to wait until I have some spare cycles.  If you could point me to where the typeHandler lookup is done, I might be able to submit a patch, if you agree it is a bug.

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 19, 2006 1:00 PM
To: dev@ibatis.apache.org
Subject: Re: specify typehandler for byte[]

 

Here is one last attempt :)

 

Try using the CTH you defined to use NUMERIC like you had at first.

 

Then in the sqlmap try to define your column to use NUMERIC i.e.  #column_name:NUMERIC#

 

 

Nathan

 

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



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 =Platform - Apps Engineering

 

 

 

 



 

Reply via email to