Closed as not planned
Description
I found BeanPropertySqlParameterSource useful for use but it still supports java 1.3 java types. Today its normal to use for temporal fields from java.time
package. But BeanPropertySqlParameterSource
know nothing how to handle that and no way to plug that functionality into.
@Override
public int getSqlType(String paramName) {
int sqlType = super.getSqlType(paramName);
if (sqlType != TYPE_UNKNOWN) {
return sqlType;
}
Class<?> propType = this.beanWrapper.getPropertyType(paramName);
return StatementCreatorUtils.javaTypeToSqlParameterType(propType);
}
this.beanWrapper
is private so extending BeanPropertySqlParameterSource
will give useless object and StatementCreatorUtils.javaTypeToSqlParameterType
stuck in old java.
Making BeanPropertySqlParameterSource.beanWrapper
protected will allow to override this class and manipulate with custom types of bean, including ones from java.time
.