babyfish-ct / jimmer

A revolutionary ORM framework for both java and kotlin.
Apache License 2.0
824 stars 80 forks source link

JdbcTypes.toJdbcType ignores dialect types for null values #600

Closed a8t3r closed 3 months ago

a8t3r commented 3 months ago

JdbcTypes.toJdbcType firstly checks the default map instead of dialect which leads to incorrect DbNull rendering on postgresql:

DbNull:46

public void setParameter(PreparedStatement stmt, ParameterIndex index, JSqlClientImplementor sqlClient) throws Exception {
    stmt.setNull(index.get(), JdbcTypes.toJdbcType(type, sqlClient.getDialect()));
}
babyfish-ct commented 3 months ago

Try 0.8.147