/** * Sets the type for the new column based on the given SQL type, target * data length (in type specific units), and target FileFormat. */ public ColumnBuilder setSQLType(int type, int lengthInUnits, Database.FileFormat fileFormat) throws SQLException { return setType(DataType.fromSQLType(type, lengthInUnits, fileFormat)); }
|| types[seq].equalsIgnoreCase(AccessType.HYPERLINK.name())) { dt = DataType.MEMO; cb.setType(dt); if (types[seq].equalsIgnoreCase(AccessType.HYPERLINK.name())) { cb.setHyperlink(true); cb.setType(dt); || types[seq].equalsIgnoreCase(AccessType.AUTOINCREMENT.name()))) { dt = TypesMap.map2Jackcess(AccessType.valueOf(types[seq].toUpperCase(Locale.US))); cb.setType(dt); cb.setLengthInUnits((short) dt.getFixedSize()); UcanaccessConnection.getCtxConnection().getDbIO().getFileFormat()); cb.setType(dt); if (length > 0 && dt.equals(DataType.TEXT)) { cb.setLengthInUnits(length); cb.setType(DataType.GUID); cb.setAutoNumber(true);
if (columnName.equals("")) columnName = "NA"; tb.addColumn(new ColumnBuilder(columnName).setType( DataType.MEMO).toColumn()); hNodeIdList.add(hNode.getId());
/** * 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; }