-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some params #{object.property} not accessible after 3.4.1 #1089
Comments
Hi @rumatoest , Thank you for the report, but I couldn't reproduce the problem. [1] Unit test or example project. |
Hello. This is more complicated bug, it appears only when my custom type handler added to mybatis environment. And it looks like mybatis calls this custom handler (even if it not used in any DAO) and pass there instace of MapperMethod.ParamMap Bug reproduced here https://github.com/kr3v/1089 |
Hi @rumatoest , Thanks for the repro! You register I'll try to look for a clean solution. |
Hi @rumatoest , This should be fixed in the latest 3.4.6 SNAPSHOT. Thank you! |
Hello. Our test are not failing any more in 3.4.6.Snapshot, but fails in 3.4.5, thus I think that bug was fixed. |
@rumatoest Thanks for verifying the fix! |
I have a simple question. |
@harawata can you post an example of a workarround ? I have a request, there are 2 Integers and one of them is failing :/ Bouth are using the same typeHandler which extends the BaseTypeHandler, Is the fix live ? |
Hi @Vilkaz , Yes, this was fixed in 3.4.6, so if it occurs with 3.4.6, it must be a different issue. It seems that your type handler calls one of 'PreparedStatement.setXxx' methods with an incompatible data. |
This happens when I'm trying to use object property in select query where condition like #{paramName.someProperty}
MyBatis version
version >= 3.4.2
Database vendor and version
Any database
Steps to reproduce
Interface
Where Product.Type - is nested enum in class Product with method
public int getId()
In XML
Expected result
Should work as in 3.4.1
Actual result
Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property. Cause: java.lang.ClassCastException: my.domain.Product$Type cannot be cast to java.lang.String
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77)
The text was updated successfully, but these errors were encountered: