You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The type handler will be calculated based on the type of the object in the parameter map - it won't be xxxProvider. But this sometimes fails, so it is best to explicitly set the type handler. The generator allows you to do this, and it will carry into the generated code.
In the generator configuration, do something like this:
In fact, I am using org.mybatis.dynamic.sql.util.mybatis3#insert to save the data, So parameterObject is DefaultInsertStatementProvider;
Therefore, the MetaClass obtained by parsing parameterType (DefaultInsertStatementProvider) cannot find "row.xxx";
(SqlSourceBuilder#buildParameterMapping), then it will continue to try to get the JavaType by "originSql";
only if JavaType is missing from "original Sql", Object.class will be used;
So we need to add 'forceJavaTypeIntoMapping' in the generator configuration to avoid this situation
mybatis: latest
After I use mybaits-generator to generate dynamic-sql
so it will use ProviderSqlSource, the parameterObject will always be xxxProvider;
When parsing sql with RawSqlSource, the ParameterMapping#JavaType will always be java.lang.Object;
I'm wondering if there is any way to make sure the ParameterMapping to get the proper type;
Because in the current scenario; if I register a JsonTypeHanlder like the following; the clazz here will become Java.lang.Object
The text was updated successfully, but these errors were encountered: