Skip to content

Made BeanPropertySqlParameterSource.beanWrapper protected #28527

Closed as not planned
@msangel

Description

@msangel

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.

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)status: declinedA suggestion or change that we don't feel we should currently apply

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions