com.sqlapp.data.db.dialect.Dialect.setDbType()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(14.0k)|赞(0)|评价(0)|浏览(206)

本文整理了Java中com.sqlapp.data.db.dialect.Dialect.setDbType()方法的一些代码示例,展示了Dialect.setDbType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dialect.setDbType()方法的具体详情如下:
包路径:com.sqlapp.data.db.dialect.Dialect
类名称:Dialect
方法名:setDbType

Dialect.setDbType介绍

[英]Columnへ値を設定します
[中]柱へ値を設定します

代码示例

代码示例来源:origin: com.sqlapp/sqlapp-core

public boolean setDbType(String productDataType, Long lengthOrPrecision,
    Integer scale, DataTypeLengthProperties<?> column) {
  return setDbType(null, productDataType, lengthOrPrecision,
      scale, column);
}

代码示例来源:origin: com.sqlapp/sqlapp-core

public boolean setDbType(DataType dataType, String productDataType,
    Long lengthOrPrecision, Integer scale,
    DataTypeLengthProperties<?> column) {
  Set<DbDataType<?>> set = CommonUtils.set();
  return setDbType(dataType, productDataType,
      lengthOrPrecision, scale,
      column, set);
}

代码示例来源:origin: com.sqlapp/sqlapp-core

public boolean setDbType(int sqlType, String productDataType,
    Long lengthOrPrecision, Integer scale,
    DataTypeLengthProperties<?> column) {
  return setDbType(DataType.valueOf(sqlType), productDataType,
      lengthOrPrecision, scale,
      column);
}

代码示例来源:origin: com.sqlapp/sqlapp-core-mysql

/**
 * Functionの引数を取得します
 * 
 * @param arg
 * @param dialect
 * @throws SQLException
 */
protected static NamedArgument getFunctionNamedArgument(String arg,
    Dialect dialect) {
  Matcher matcher = FUNCTION_ARGUMENT_PATTERN.matcher(arg);
  matcher.matches();
  String name = matcher.group(1);
  String productDataType = matcher.group(2);
  NamedArgument obj = new NamedArgument(name);
  dialect.setDbType(productDataType,null, null, obj);
  return obj;
}

代码示例来源:origin: com.sqlapp/sqlapp-core-mysql

/**
 * Procedureの引数を取得します
 * 
 * @param arg
 * @param dialect
 * @throws SQLException
 */
protected static void setProcedureNamedArgument(String arg,
    NamedArgument obj) {
  Matcher matcher = PROCEDURE_ARGUMENT_PATTERN.matcher(arg);
  matcher.matches();
  String inOut = matcher.group(1);
  String name = matcher.group(2);
  String productDataType = matcher.group(3);
  obj.setName(name);
  obj.setDirection(ParameterDirection.parse(inOut));
  obj.getDialect().setDbType(productDataType, null, null, obj);
}

代码示例来源:origin: com.sqlapp/sqlapp-core

public void setDbType(String productDataType, DataTypeProperties<?> column) {
  Column temp=new Column();
  setDbType(productDataType, null,null, temp);
  column.setDataType(temp.getDataType());
  SchemaUtils.setDataTypeNameInternal(column.getDataTypeName(), temp);
}

代码示例来源:origin: com.sqlapp/sqlapp-core-db2

protected Column createColumn(ExResultSet rs) throws SQLException {
  Column obj = super.createColumn(rs);
  String stringUnits=getString(rs, "TYPESTRINGUNITS");
  if (stringUnits!=null){
    obj.setStringUnits(stringUnits);
    Integer stringunitLength=getInteger(rs, "STRINGUNITSLENGTH");
    if (stringunitLength!=null){
      obj.setLength(stringunitLength);
      this.getDialect().setDbType(obj.getDataTypeName(), stringunitLength.longValue(), null, obj);
    }
  }
  return obj;
}

代码示例来源:origin: com.sqlapp/sqlapp-core-db2

protected NamedArgument createArgument(ExResultSet rs) throws SQLException {
  NamedArgument obj = createObject("PARMNAME");
  Long length = this.getLong(rs, "LENGTH");
  Integer scale = this.getInteger(rs, "SCALE");
  obj.setCollation(getString(rs, "COLLATIONNAME"));
  obj.setDefaultValue(getString(rs, "DEFAULT"));
  obj.setRemarks(getString(rs, REMARKS));
  String rowType=getString(rs, "ROWTYPE");
  if ("B".equalsIgnoreCase(rowType)){
    obj.setDirection(ParameterDirection.Inout);
  }else if ("O".equalsIgnoreCase(rowType)){
    obj.setDirection(ParameterDirection.Output);
  }else if ("P".equalsIgnoreCase(rowType)){
    obj.setDirection(ParameterDirection.Input);
  }
  String productDataType = getString(rs, "TYPENAME");
  this.getDialect().setDbType(productDataType, length, scale, obj);
  return obj;
}

代码示例来源:origin: com.sqlapp/sqlapp-core-db2

protected NamedArgument createArgument(ExResultSet rs) throws SQLException {
  NamedArgument obj = createObject("PARMNAME");
  Long length = this.getLong(rs, "LENGTH");
  Integer scale = this.getInteger(rs, "SCALE");
  obj.setCollation(getString(rs, "COLLATIONNAME"));
  obj.setDefaultValue(getString(rs, "DEFAULT"));
  obj.setRemarks(getString(rs, REMARKS));
  String rowType=getString(rs, "ROWTYPE");
  if ("B".equalsIgnoreCase(rowType)){
    obj.setDirection(ParameterDirection.Inout);
  }else if ("O".equalsIgnoreCase(rowType)){
    obj.setDirection(ParameterDirection.Output);
  }else if ("P".equalsIgnoreCase(rowType)){
    obj.setDirection(ParameterDirection.Input);
  }
  String productDataType = getString(rs, "TYPENAME");
  this.getDialect().setDbType(productDataType, length, scale, obj);
  return obj;
}

代码示例来源:origin: com.sqlapp/sqlapp-core-mysql

protected NamedArgument createNamedArgument(ExResultSet rs, String arg)
    throws SQLException {
  Function routine = new Function(getString(rs, ROUTINE_NAME));
  routine.setDialect(this.getDialect());
  routine.setCatalogName(getString(rs, CATALOG_NAME));
  routine.setSchemaName(getString(rs, SCHEMA_NAME));
  routine.setSpecificName(getString(rs, SPECIFIC_NAME));
  Matcher matcher = MySqlFunctionReader.ARGUMENT_PATTERN.matcher(arg);
  matcher.matches();
  String name = matcher.group(1);
  String productDataType = matcher.group(2);
  NamedArgument obj = createObject(name);
  obj.setCatalogName(getString(rs, CATALOG_NAME));
  obj.setSchemaName(getString(rs, SCHEMA_NAME));
  SchemaUtils.setRoutine(obj, routine);
  this.getDialect().setDbType(productDataType, null,null,
      obj);
  return obj;
}

代码示例来源:origin: com.sqlapp/sqlapp-core-db2

protected TypeColumn createTypeColumn(ExResultSet rs) throws SQLException {
  TypeColumn obj = createObject(getString(rs, COLUMN_NAME));
  obj.setTypeName(TYPE_NAME);
  obj.setSchemaName(SCHEMA_NAME);
  Long length = this.getLong(rs, "LENGTH");
  Integer scale = this.getInteger(rs, "SCALE");
  String productDataType = getString(rs, DATA_TYPE);
  this.getDialect().setDbType(productDataType, length, scale, obj);
  String logged = trim(getString(rs, "LOGGED"));
  if (!isEmpty(logged)) {
    setSpecifics(rs, "LOGGED", obj);
  }
  return obj;
}

代码示例来源:origin: com.sqlapp/sqlapp-core-sqlserver

protected Domain createDomain(ExResultSet rs) throws SQLException {
    String name = getString(rs, DOMAIN_NAME);
    Domain obj = new Domain(name);
    String productDataType = getString(rs, "base_type_name");
    Long byteLength = getLong(rs, "length");
    Long max_length = SqlServerUtils.getMaxLength(productDataType,
        byteLength);
    Long prec = getLong(rs, "prec");
    Integer scale = getInteger(rs, "scale");
    obj.setNullable(rs.getBoolean("allownulls"));
    getDialect().setDbType(productDataType, notZero(max_length, prec),
        scale, obj);
    obj.setCatalogName(getString(rs, CATALOG_NAME));
    obj.setSchemaName(getString(rs, SCHEMA_NAME));
    setSpecifics(rs, "collation_name", obj);
    return obj;
  }
}

代码示例来源:origin: com.sqlapp/sqlapp-core-sybase

protected Domain createDomain(ExResultSet rs) throws SQLException {
    String name = getString(rs, DOMAIN_NAME);
    Domain obj = new Domain(name);
    String productDataType = getString(rs, "base_type_name");
    Long byteLength = getLong(rs, "length");
    Long max_length = SybaseUtils.getMaxLength(productDataType,
        byteLength);
    Long prec = getLong(rs, "prec");
    Integer scale = getInteger(rs, "scale");
    obj.setNullable(rs.getBoolean("allownulls"));
    getDialect().setDbType(productDataType, notZero(max_length, prec),
        scale, obj);
    obj.setCatalogName(getString(rs, CATALOG_NAME));
    obj.setSchemaName(getString(rs, SCHEMA_NAME));
    setSpecifics(rs, "collation_name", obj);
    return obj;
  }
}

代码示例来源:origin: com.sqlapp/sqlapp-core-sybase

protected static void setNamedArgument(Dialect dialect, ResultSet rs,
    NamedArgument obj, Routine<?> routine) throws SQLException {
  routine.setCatalogName(getString(rs, MetadataReader.CATALOG_NAME));
  routine.setSchemaName(getString(rs, MetadataReader.SCHEMA_NAME));
  routine.setName(getString(rs, MetadataReader.ROUTINE_NAME));
  obj.setCatalogName(getString(rs, MetadataReader.CATALOG_NAME));
  obj.setSchemaName(getString(rs, MetadataReader.SCHEMA_NAME));
  SchemaUtils.setRoutine(obj, routine);
  String productDataType = getString(rs, "NAME");
  Long max_length = getLong(rs, "max_length");
  Long precision = getLong(rs, "precision");
  Integer scale = getInteger(rs, "scale");
  obj.setDefaultValue(getString(rs, "default_value"));
  obj.setReadonly(getBoolean(rs, "is_readonly"));
  dialect.setDbType(productDataType, notZero(max_length, precision),
      scale, obj);
}

代码示例来源:origin: com.sqlapp/sqlapp-core-sybase

protected Function createFunction(ExResultSet rs) throws SQLException {
  Timestamp created = rs.getTimestamp("created");
  Timestamp lastAltered = rs.getTimestamp("last_altered");
  Function obj = new Function(getString(rs, ROUTINE_NAME));
  obj.setSpecificName(getString(rs, SPECIFIC_NAME));
  obj.setCatalogName(getString(rs, "specific_catalog"));
  obj.setSchemaName(getString(rs, "specific_schema"));
  obj.setCreatedAt(created);
  obj.setLastAlteredAt(lastAltered);
  String definition = getString(rs, "routine_definition");
  if (this.getReaderOptions().isReadDefinition()) {
    obj.setDefinition(definition);
  }
  FunctionReturning ret = obj.getReturning();
  String productDataType=SybaseUtils.getFunctionReturnName(definition);
  this.getDialect().setDbType(productDataType,
      null, null, ret);
  return obj;
}

代码示例来源:origin: com.sqlapp/sqlapp-core-sqlserver

protected Function createFunction(ExResultSet rs) throws SQLException {
  Timestamp created = rs.getTimestamp("created");
  Timestamp lastAltered = rs.getTimestamp("last_altered");
  Function obj = new Function(getString(rs, ROUTINE_NAME));
  obj.setSpecificName(getString(rs, SPECIFIC_NAME));
  obj.setCatalogName(getString(rs, "specific_catalog"));
  obj.setSchemaName(getString(rs, "specific_schema"));
  obj.setCreatedAt(created);
  obj.setLastAlteredAt(lastAltered);
  String definition = getString(rs, "routine_definition");
  if (this.getReaderOptions().isReadDefinition()) {
    obj.setDefinition(definition);
  }
  FunctionReturning ret = obj.getReturning();
  String productDataType=SqlServerUtils.getFunctionReturnName(definition);
  this.getDialect().setDbType(productDataType,
      null, null, ret);
  return obj;
}

代码示例来源:origin: com.sqlapp/sqlapp-core-sqlserver

protected PartitionFunction createPartitionFunction(ExResultSet rs)
      throws SQLException {
    String catalog_name = getString(rs, CATALOG_NAME);
    String name = getString(rs, PARTITION_FUNCTION_NAME);
    PartitionFunction obj = new PartitionFunction(name);
    obj.setCatalogName(catalog_name);
    obj.setCreatedAt(rs.getTimestamp("create_date"));
    obj.setLastAlteredAt(rs.getTimestamp("modify_date"));
    String productDataType = getString(rs, "type_name");
    Long byteLength = getLong(rs, "max_length");
    Long maxLength = SqlServerUtils.getMaxLength(productDataType,
        byteLength);
    Long precision=rs.getLongValue("precision");
    Integer scale=rs.getInteger("scale");
    obj.setDataTypeName(productDataType);
    this.getDialect().setDbType(productDataType, CommonUtils.notZero(maxLength, precision), scale, obj);
    obj.setBoundaryValueOnRight(rs.getBoolean("boundary_value_on_right"));
    obj.setId("" + rs.getInt("function_id"));
    return obj;
  }
}

代码示例来源:origin: com.sqlapp/sqlapp-core-mysql

@Override
protected Function createFunction(ExResultSet rs,
    ProductVersionInfo productVersionInfo) throws SQLException {
  if (productVersionInfo.lt(5, 5, 3)) {
    return super.createFunction(rs, productVersionInfo);
  }
  Function obj = new Function(getString(rs, ROUTINE_NAME));
  obj.setDialect(getDialect());
  MySqlUtils.setRoutineInfo(rs, obj);
  String productDataType = getString(rs, "DATA_TYPE");
  long maxLength = rs.getLong("CHARACTER_MAXIMUM_LENGTH");
  long octetLength = rs.getLong("CHARACTER_OCTET_LENGTH");
  long numericPrecision = rs.getLong("NUMERIC_PRECISION");
  Integer numericScale = getInteger(rs, "NUMERIC_SCALE");
  obj.getReturning().setCharacterSet(getString(rs, CHARACTER_SET_NAME));
  obj.getReturning().setCollation(getString(rs, COLLATION_NAME));
  obj.getReturning().setDataTypeName(productDataType);
  this.getDialect().setDbType(productDataType, CommonUtils.notZero(maxLength, numericPrecision), numericScale, obj.getReturning());
  obj.getReturning().setOctetLength(octetLength);
  return obj;
}

代码示例来源:origin: com.sqlapp/sqlapp-core-mysql

protected NamedArgument createNamedArgument(ExResultSet rs)
    throws SQLException {
  Function routine = new Function(getString(rs, SPECIFIC_NAME));
  routine.setDialect(this.getDialect());
  routine.setCatalogName(getString(rs, SPECIFIC_CATALOG));
  routine.setSchemaName(getString(rs, SPECIFIC_SCHEMA));
  NamedArgument obj = createObject(getString(rs, PARAMETER_NAME));
  SchemaUtils.setRoutine(obj, routine);
  obj.setCatalogName(getString(rs, SPECIFIC_CATALOG));
  obj.setSchemaName(getString(rs, SPECIFIC_SCHEMA));
  String productDataType = getString(rs, "DATA_TYPE");
  long maxLength = rs.getLong("CHARACTER_MAXIMUM_LENGTH");
  long numericPrecision = rs.getLong("NUMERIC_PRECISION");
  Integer numericScale = getInteger(rs, "NUMERIC_SCALE");
  getDialect().setDbType(productDataType, notZero(maxLength, numericPrecision), numericScale, obj);
  obj.setCharacterSet(getString(rs, CHARACTER_SET_NAME));
  obj.setCollation(getString(rs, COLLATION_NAME));
  obj.setDirection(ParameterDirection.parse(getString(rs,
      "PARAMETER_MODE")));
  return obj;
}

代码示例来源:origin: com.sqlapp/sqlapp-core-mysql

protected NamedArgument createNamedArgument(ExResultSet rs)
    throws SQLException {
  Procedure routine = new Procedure();
  routine.setCatalogName(getString(rs, SPECIFIC_CATALOG));
  routine.setSchemaName(getString(rs, SPECIFIC_SCHEMA));
  routine.setName(getString(rs, SPECIFIC_NAME));
  routine.setSpecificName(getString(rs, SPECIFIC_NAME));
  NamedArgument obj = new NamedArgument(getString(rs, PARAMETER_NAME));
  SchemaUtils.setRoutine(obj, routine);
  obj.setCatalogName(getString(rs, SPECIFIC_CATALOG));
  obj.setSchemaName(getString(rs, SPECIFIC_SCHEMA));
  String productDataType = getString(rs, "DATA_TYPE");
  long maxLength = rs.getLong("CHARACTER_MAXIMUM_LENGTH");
  long numericPrecision = rs.getLong("NUMERIC_PRECISION");
  Integer numericScale = getInteger(rs, "NUMERIC_SCALE");
  getDialect().setDbType(productDataType, notZero(maxLength, numericPrecision), numericScale, obj);
  obj.setCharacterSet(getString(rs, CHARACTER_SET_NAME));
  obj.setCollation(getString(rs, COLLATION_NAME));
  obj.setDirection(ParameterDirection.parse(getString(rs,
      "PARAMETER_MODE")));
  return obj;
}

相关文章