Comments (4)
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.
Original comment by [email protected]
on 31 May 2010 at 1:47
- Changed state: Invalid
from mybatis.
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.
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)
- [mybatis-spring] Mapper scanning should not rely on proprietary @Mapper annotation HOT 1
- Migrations archive unzips to "ibatis-migrations" instead of "mybatis-migrations" HOT 2
- OSGI Support HOT 4
- Remove mapper order restriction when referencing SQL fragment in another file. HOT 40
- Non-existent object id is incorrectly resolved when there is an entry with the same short name. HOT 13
- Allow applying @Transactional to types and interfaces and add a @NoTransaction attribute HOT 4
- Please prioritize issues HOT 1
- Adjust issue's status HOT 1
- Unable to get auto-generated ID with mysql using annotations HOT 1
- Mybatis-spring doesn't propagate exceptions up the stack when using batch mode HOT 17
- how to free temp tablespace allocated for a select stmt return parameter HOT 1
- rollback on BatchExecutor executes batched statements HOT 8
- resultMap doesn't support mapping of unnamed columns by index HOT 2
- mybatis3.0.3 bug in WebService ?? HOT 2
- Annotation-based and AOP-based sessions HOT 3
- Global parameter typeHandler not invoked in case of null values HOT 2
- Exception: Result Maps collection does not contain value for test.User-result HOT 2
- Handling of update counts before result sets in select HOT 8
- configure behavior when all columns values are null for some rows HOT 5
- queryForMap does not use a column as map HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mybatis.