Java Code Examples for org.springframework.jdbc.core.StatementCreatorUtils#javaTypeToSqlParameterType()
The following examples show how to use
org.springframework.jdbc.core.StatementCreatorUtils#javaTypeToSqlParameterType() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BeanPropertySqlParameterSource.java From spring-analysis-note with MIT License | 5 votes |
/** * Derives a default SQL type from the corresponding property type. * @see org.springframework.jdbc.core.StatementCreatorUtils#javaTypeToSqlParameterType */ @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); }
Example 2
Source File: BeanPropertySqlParameterSource.java From java-technology-stack with MIT License | 5 votes |
/** * Derives a default SQL type from the corresponding property type. * @see org.springframework.jdbc.core.StatementCreatorUtils#javaTypeToSqlParameterType */ @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); }
Example 3
Source File: BeanPropertySqlParameterSource.java From lams with GNU General Public License v2.0 | 5 votes |
/** * Derives a default SQL type from the corresponding property type. * @see org.springframework.jdbc.core.StatementCreatorUtils#javaTypeToSqlParameterType */ @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); }
Example 4
Source File: BeanPropertySqlParameterSource.java From spring4-understanding with Apache License 2.0 | 5 votes |
/** * Derives a default SQL type from the corresponding property type. * @see org.springframework.jdbc.core.StatementCreatorUtils#javaTypeToSqlParameterType */ @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); }
Example 5
Source File: SqlParameterSourceBuilder.java From SimpleFlatMapper with MIT License | 5 votes |
private static int getParameterType(PropertyMapping<?, ?, JdbcColumnKey> pm) { Class<?> propertyType = TypeHelper.toClass(pm.getPropertyMeta().getPropertyType()); if (pm.getColumnDefinition().has(SqlTypeColumnProperty.class)) { return pm.getColumnDefinition().lookFor(SqlTypeColumnProperty.class).getSqlType(); } int t = StatementCreatorUtils.javaTypeToSqlParameterType(propertyType); if (t == SqlTypeValue.TYPE_UNKNOWN) { //IFJAVA8_START if (propertyType.equals(ZonedDateTime.class) || propertyType.equals(OffsetDateTime.class)) { return Types.TIMESTAMP_WITH_TIMEZONE; } if (propertyType.equals(Instant.class) || propertyType.equals(LocalDateTime.class)) { return Types.TIMESTAMP; } if (propertyType.equals(LocalDate.class)) { return Types.DATE; } if (propertyType.equals(LocalTime.class)) { return Types.TIME; } //IFJAVA8_END return JdbcColumnKey.UNDEFINED_TYPE; } return t; }
Example 6
Source File: BeanPropertySqlParameterSource.java From effectivejava with Apache License 2.0 | 5 votes |
/** * Derives a default SQL type from the corresponding property type. * @see org.springframework.jdbc.core.StatementCreatorUtils#javaTypeToSqlParameterType */ @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); }