public int getSqlType(Object[] properties) { if (properties != null) { for(int i = 0; i < properties.length; i++) { Object prop = properties[i]; if (prop instanceof SqlTypeColumnProperty) { return ((SqlTypeColumnProperty)prop).getSqlType(); } } } return sqlType; }
public int getSqlType(Object[] properties) { if (properties != null) { for(int i = 0; i < properties.length; i++) { Object prop = properties[i]; if (prop instanceof SqlTypeColumnProperty) { return ((SqlTypeColumnProperty)prop).getSqlType(); } } } return sqlType; }
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; }
@Override protected JdbcColumnKey newKey(String column, int i, FieldMapperColumnDefinition<JdbcColumnKey> columnDefinition) { JdbcColumnKey key = new JdbcColumnKey(column, i); SqlTypeColumnProperty typeColumnProperty = columnDefinition.lookFor(SqlTypeColumnProperty.class); if (typeColumnProperty == null) { ColumnDefinition<JdbcColumnKey, ?> globalDef = mapperConfig.columnDefinitions().getColumnDefinition(key); typeColumnProperty = globalDef.lookFor(SqlTypeColumnProperty.class); } if (typeColumnProperty != null) { return new JdbcColumnKey(key.getName(), key.getIndex(), typeColumnProperty.getSqlType(), key); } return key; }
@Override protected JdbcColumnKey newKey(String column, int i, FieldMapperColumnDefinition<JdbcColumnKey> columnDefinition) { JdbcColumnKey key = new JdbcColumnKey(column, i); SqlTypeColumnProperty typeColumnProperty = columnDefinition.lookFor(SqlTypeColumnProperty.class); if (typeColumnProperty == null) { ColumnDefinition<JdbcColumnKey, ?> globalDef = mapperConfig.columnDefinitions().getColumnDefinition(key); typeColumnProperty = globalDef.lookFor(SqlTypeColumnProperty.class); } if (typeColumnProperty != null) { return new JdbcColumnKey(key.getName(), key.getIndex(), typeColumnProperty.getSqlType(), key); } return key; }