Skip to content

ProviderSqlSource#createSqlSource passed a wrong type to languageDriver#createSqlSource #3412

Closed
@mindfn

Description

@mindfn

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

public class JsonTypeHandler<T> extends BaseTypeHandler<T> {
    
    private final Class<T> clazz;

    public JsonTypeHandler(Class<T> clazz) {
        // Java.lang.Object
        this.clazz = clazz;
    }

    @Override
    public void setNonNullParameter(PreparedStatement ps, int i, T parameter, JdbcType jdbcType) throws SQLException {    
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions