当前位置: 首页>>代码示例>>Java>>正文


Java ColumnBuilder.getType方法代码示例

本文整理汇总了Java中com.healthmarketscience.jackcess.ColumnBuilder.getType方法的典型用法代码示例。如果您正苦于以下问题:Java ColumnBuilder.getType方法的具体用法?Java ColumnBuilder.getType怎么用?Java ColumnBuilder.getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.healthmarketscience.jackcess.ColumnBuilder的用法示例。


在下文中一共展示了ColumnBuilder.getType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getColumnBitFlags

import com.healthmarketscience.jackcess.ColumnBuilder; //导入方法依赖的package包/类
/**
 * Constructs a byte containing the flags for this column.
 */
private static byte getColumnBitFlags(ColumnBuilder col) {
  byte flags = UPDATABLE_FLAG_MASK;
  if(!col.isVariableLength()) {
    flags |= FIXED_LEN_FLAG_MASK;
  }
  if(col.isAutoNumber()) {
    byte autoNumFlags = 0;
    switch(col.getType()) {
    case LONG:
    case COMPLEX_TYPE:
      autoNumFlags = AUTO_NUMBER_FLAG_MASK;
      break;
    case GUID:
      autoNumFlags = AUTO_NUMBER_GUID_FLAG_MASK;
      break;
    default:
      // unknown autonum type
    }
    flags |= autoNumFlags;
  }
  if(col.isHyperlink()) {
    flags |= HYPERLINK_FLAG_MASK;
  }
  return flags;
}
 
开发者ID:jahlborn,项目名称:jackcess,代码行数:29,代码来源:ColumnImpl.java

示例2: validateColumn

import com.healthmarketscience.jackcess.ColumnBuilder; //导入方法依赖的package包/类
protected void validateColumn(Set<String> colNames, ColumnBuilder column) {

      // FIXME for now, we can't create complex columns
      if(column.getType() == DataType.COMPLEX_TYPE) {
        throw new UnsupportedOperationException(withErrorContext(
            "Complex column creation is not yet implemented"));
      }
      
      column.validate(getFormat());
      if(!colNames.add(DatabaseImpl.toLookupName(column.getName()))) {
        throw new IllegalArgumentException(withErrorContext(
            "duplicate column name: " + column.getName()));
      }

      setColumnSortOrder(column);
  }
 
开发者ID:jahlborn,项目名称:jackcess,代码行数:17,代码来源:TableMutator.java

示例3: toColumns

import com.healthmarketscience.jackcess.ColumnBuilder; //导入方法依赖的package包/类
/**
 * Returns a List of Column instances converted from the given
 * ResultSetMetaData (this is the same method used by the various {@code
 * importResultSet()} methods).
 *
 * @return a List of Columns
 */
public static List<ColumnBuilder> toColumns(ResultSetMetaData md)
  throws SQLException
{
    List<ColumnBuilder> columns = new LinkedList<ColumnBuilder>();
    for (int i = 1; i <= md.getColumnCount(); i++) {
      ColumnBuilder column = new ColumnBuilder(md.getColumnName(i))
        .escapeName();
      int lengthInUnits = md.getColumnDisplaySize(i);
      column.setSQLType(md.getColumnType(i), lengthInUnits);
      DataType type = column.getType();
      // we check for isTrueVariableLength here to avoid setting the length
      // for a NUMERIC column, which pretends to be var-len, even though it
      // isn't
      if(type.isTrueVariableLength() && !type.isLongValue()) {
        column.setLengthInUnits((short)lengthInUnits);
      }
      if(type.getHasScalePrecision()) {
        int scale = md.getScale(i);
        int precision = md.getPrecision(i);
        if(type.isValidScale(scale)) {
          column.setScale((byte)scale);
        }
        if(type.isValidPrecision(precision)) {
          column.setPrecision((byte)precision);
        }
      }
      columns.add(column);
    }
    return columns;
}
 
开发者ID:jahlborn,项目名称:jackcess,代码行数:38,代码来源:ImportUtil.java


注:本文中的com.healthmarketscience.jackcess.ColumnBuilder.getType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。