/** * Sets the scale for the new column to the max length for the type. Does * nothing for types which do not have a scale. */ public ColumnBuilder setMaxScale() { if(_type.getHasScalePrecision()) { setScale(_type.getMaxScale()); } return this; }
int precision = md.getPrecision(i); if(type.isValidScale(scale)) { column.setScale((byte)scale);
cb.setScale(scale); if (length > 0) { cb.setPrecision(length);
/** * Sets all attributes except name from the given Column template (including * all column properties except GUID). */ public ColumnBuilder setFromColumn(Column template) throws IOException { DataType type = template.getType(); setType(type); setLength(template.getLength()); setAutoNumber(template.isAutoNumber()); if(type.getHasScalePrecision()) { setScale(template.getScale()); setPrecision(template.getPrecision()); } setCalculated(template.isCalculated()); setCompressedUnicode(template.isCompressedUnicode()); setHyperlink(template.isHyperlink()); if(template instanceof ColumnImpl) { setTextSortOrder(((ColumnImpl)template).getTextSortOrder()); } PropertyMap colProps = template.getProperties(); for(PropertyMap.Property colProp : colProps) { // copy everything but guid if(!PropertyMap.GUID_PROP.equalsIgnoreCase(colProp.getName())) { setProperty(colProp.getName(), colProp); } } return this; }