Closed
Description
When I specify a custom typeHandler, in my case for mapping org.javamoney.moneta.FastMoney
to JdbcType.INTEGER
for a PostGreSQL database using org.mybatis.dynamic.sql.SqlTable#column(...)
, the type handler does not seem to handle my query parameter values e.g. upon calling SelectStatementProvider#getParameters()
as argument for the constructor of MapSqlParameterSource(Map<>)
required by Spring's NamedParameterJdbcTemplate#query(...)
, and I get:
org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select ...]; nested exception is org.postgresql.util.PSQLException: Can't infer the SQL type to use for an instance of org.javamoney.moneta.FastMoney. Use setObject() with an explicit Types value to specify the type to use.