Giter VIP home page Giter VIP logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
If the executor is attempting to find your typeHandler with a null JDBC type, 
it's
possible that the result mapping isn't specifying the jdbcType.  For example:

<result ... javaType="String" jdbcType="VARCHAR"> 

...would look up java.lang.String and Types.VARCHAR in the TYPE_HANDLER_MAP.  
But...

<result ... javaType="String">

...would look up java.lang.String and null in the TYPE_HANDLER_MAP.

You can register your date typehandler without specifying the jdbcType so that 
it
applies to ALL date types, regardless of the column in the database.  So using 
your
example:

<typeHandler javaType="java.util.GregorianCalendar" 
             handler="somepackage.GregorianCalendarTypeHandler"/>

If you feel that this is incorrect, then maybe file a unit test or another 
example
demonstrating the failure.

Cheers,
Clinton

Original comment by [email protected] on 31 May 2010 at 1:47

from mybatis.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024

Original comment by [email protected] on 31 May 2010 at 1:47

  • Changed state: Invalid

from mybatis.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
Hi Clinton!

Thank you for your answer.

As I see the iBatis can figure out the mappings so currently I'm not using any 
result
mapping for my statement. Is this a mistake on my side? I think when the 
statement
doesn't defines a resultMap (it uses instead a resultType) the
ResultSetMetaData#getcolumnType() should be used to figure out the column's 
JDBC type.

I have jared up and uploadad a dummy maven project that contains the POJOs and 
the
mapping that I'm using to show you what I am doing exactly.

Regards, István.

Original comment by [email protected] on 31 May 2010 at 7:15

Attachments:

from mybatis.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
I've experienced a similar issue to the described above.

In my case (described also here: 
http://stackoverflow.com/questions/20122157/mybatis-custom-typehandler-not-execu
ted-when-put-in-result-tag/) I had a custom typeHandler attached to <result> 
tag:

<result property="SERVICES_XML" javaType="string" jdbcType="CLOB" 
typeHandler="com.foo.bar.OracleClobTypeHandler" />

That didn't work unless I explicitly specified "column" attribute for the above 
<result> tag. 
If this is the expected behaviour, it definitely needs to be documented. 

Original comment by [email protected] on 21 Nov 2013 at 1:59

from mybatis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.