private void setDataType(BaseColumn baseColumn) { Datatype dataType = (Datatype) getByType(MetadataConstants.RECORD_TYPE.DATATYPE).get(baseColumn.getDatatypeUUID()); int arrayDimensions = 0; String type = baseColumn.getRuntimeType(); while (DataTypeManager.isArrayType(type)) { arrayDimensions++; type = type.substring(0, type.length()-2); } baseColumn.setDatatype(dataType, false, arrayDimensions); if (baseColumn.getLength() == 0) { if (DataTypeManager.hasLength(type)) { Class<?> baseType = DataTypeManager.getDataTypeClass(type); //designer sends a default length of 0 as a default, but the engine does not expect that generally Integer length = JDBCSQLTypeInfo.getMaxDisplaySize(baseType); if (length != null) { baseColumn.setLength(length); } } } }
private void setDataType(BaseColumn baseColumn) { Datatype dataType = (Datatype) getByType(MetadataConstants.RECORD_TYPE.DATATYPE).get(baseColumn.getDatatypeUUID()); int arrayDimensions = 0; String type = baseColumn.getRuntimeType(); while (DataTypeManager.isArrayType(type)) { arrayDimensions++; type = type.substring(0, type.length()-2); } baseColumn.setDatatype(dataType, false, arrayDimensions); if (baseColumn.getLength() == 0) { if (DataTypeManager.hasLength(type)) { Class<?> baseType = DataTypeManager.getDataTypeClass(type); //designer sends a default length of 0 as a default, but the engine does not expect that generally Integer length = JDBCSQLTypeInfo.getMaxDisplaySize(baseType); if (length != null) { baseColumn.setLength(length); } } } }
public static void setTypeInfo(ParsedDataType type, BaseColumn column) { if (type.length != null){ column.setLength(type.length); } if (type.precision != null){ if (type.precision == 0) { throw new MetadataException(QueryPlugin.Util.getString("SQLParser.zero_precision")); //$NON-NLS-1$ } column.setPrecision(type.precision); if (type.scale != null){ if (Math.abs(type.scale) > type.precision) { throw new MetadataException(QueryPlugin.Util.getString("SQLParser.invalid_scale", type.scale, type.precision)); //$NON-NLS-1$ } column.setScale(type.scale); } else { column.setScale(0); } } }
static void setTypeInfo(ParsedDataType type, BaseColumn column) { if (type.length != null){ column.setLength(type.length); } if (type.precision != null){ if (type.precision == 0) { throw new MetadataException(QueryPlugin.Util.getString("SQLParser.zero_precision")); //$NON-NLS-1$ } column.setPrecision(type.precision); if (type.scale != null){ if (Math.abs(type.scale) > type.precision) { throw new MetadataException(QueryPlugin.Util.getString("SQLParser.invalid_scale", type.scale, type.precision)); //$NON-NLS-1$ } column.setScale(type.scale); } else { column.setScale(0); } } }
public static void setTypeInfo(ParsedDataType type, BaseColumn column) { if (type.length != null){ column.setLength(type.length); } if (type.precision != null){ if (type.precision == 0) { throw new MetadataException(QueryPlugin.Util.getString("SQLParser.zero_precision")); //$NON-NLS-1$ } column.setPrecision(type.precision); if (type.scale != null){ if (Math.abs(type.scale) > type.precision) { throw new MetadataException(QueryPlugin.Util.getString("SQLParser.invalid_scale", type.scale, type.precision)); //$NON-NLS-1$ } column.setScale(type.scale); } else { column.setScale(0); } } }
record.setNativeType(typeName); record.setPrecision(precision); record.setLength(columns.getInt(9)); record.setScale(scale); record.setRadix(columns.getInt(11));