本文整理了Java中org.teiid.metadata.Datatype.getLength()
方法的一些代码示例,展示了Datatype.getLength()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Datatype.getLength()
方法的具体详情如下:
包路径:org.teiid.metadata.Datatype
类名称:Datatype
方法名:getLength
[英]Get the length of the type. For string (binary or character) types, it is the number of characters. For all other types it is the byte storage size.
[中]获取类型的长度。对于字符串(二进制或字符)类型,它是字符数。对于所有其他类型,它是字节存储大小。
代码示例来源:origin: teiid/teiid
row.add(datatype.getJavaClassName());
row.add(datatype.getScale());
row.add(datatype.getLength());
row.add(datatype.getNullType().toString());
row.add(datatype.isSigned());
代码示例来源:origin: org.jboss.teiid/teiid-engine
row.add(datatype.getJavaClassName());
row.add(datatype.getScale());
row.add(datatype.getLength());
row.add(datatype.getNullType().toString());
row.add(datatype.isSigned());
代码示例来源:origin: org.teiid/teiid-engine
row.add(datatype.getJavaClassName());
row.add(datatype.getScale());
row.add(datatype.getLength());
row.add(datatype.getNullType().toString());
row.add(datatype.isSigned());
代码示例来源:origin: teiid/teiid
public void setDatatype(Datatype datatype, boolean copyAttributes, int arrayDimensions) {
this.datatype = datatype;
this.arrayDimensions = arrayDimensions;
if (datatype != null) {
this.datatypeUUID = this.datatype.getUUID();
this.runtimeType = this.datatype.getRuntimeTypeName();
if (arrayDimensions > 0) {
this.runtimeType += StringUtil.join(Collections.nCopies(arrayDimensions, "[]"), ""); //$NON-NLS-1$ //$NON-NLS-2$
}
if (copyAttributes) {
this.radix = this.datatype.getRadix();
this.length = this.datatype.getLength();
if (!datatype.getName().equals(DataTypeManager.DefaultDataTypes.BIG_DECIMAL)) {
this.precision = this.datatype.getPrecision();
this.scale = this.datatype.getScale();
}
this.nullType = this.datatype.getNullType();
}
}
}
代码示例来源:origin: teiid/teiid
@Test
public void testCreateDomainUsedInSchema() throws Exception {
String ddl = "CREATE DATABASE FOO VERSION '2.0.0'; USE DATABASE FOO VERSION '2.0.0';"
+ "CREATE DOMAIN my_string AS string(1000) not null;"
+ "CREATE SCHEMA S1; SET SCHEMA S1;"
+ "CREATE VIEW X (y my_string) as select 'a';";
Database db = helpParse(ddl);
assertEquals(1000, db.getMetadataStore().getDatatypes().get("my_string").getLength());
}
代码示例来源:origin: org.jboss.teiid/teiid-engine
private void visit(Datatype dt) {
append(CREATE).append(SPACE).append(DOMAIN).append(SPACE);
append(SQLStringVisitor.escapeSinglePart(dt.getName())).append(SPACE).append(AS).append(SPACE);
String runtimeTypeName = dt.getBasetypeName();
append(runtimeTypeName);
Datatype base = SystemMetadata.getInstance().getRuntimeTypeMap().get(runtimeTypeName);
if (LENGTH_DATATYPES.contains(runtimeTypeName)) {
if (dt.getLength() != base.getLength()) {
append(LPAREN).append(dt.getLength()).append(RPAREN);
}
} else if (PRECISION_DATATYPES.contains(runtimeTypeName)
&& (dt.getPrecision() != base.getPrecision() || dt.getScale() != base.getScale())) {
append(LPAREN).append(dt.getPrecision());
if (dt.getScale() != 0) {
append(COMMA).append(dt.getScale());
}
append(RPAREN);
}
if (dt.getNullType() == NullType.No_Nulls) {
append(SPACE).append(NOT_NULL);
}
append(SEMICOLON);
}
代码示例来源:origin: org.teiid/teiid-engine
private void visit(Datatype dt) {
append(CREATE).append(SPACE).append(DOMAIN).append(SPACE);
append(SQLStringVisitor.escapeSinglePart(dt.getName())).append(SPACE).append(AS).append(SPACE);
String runtimeTypeName = dt.getBasetypeName();
append(runtimeTypeName);
Datatype base = SystemMetadata.getInstance().getRuntimeTypeMap().get(runtimeTypeName);
if (DataTypeManager.hasLength(runtimeTypeName)) {
if (dt.getLength() != base.getLength()) {
append(LPAREN).append(dt.getLength()).append(RPAREN);
}
} else if (PRECISION_DATATYPES.contains(runtimeTypeName)
&& (dt.getPrecision() != base.getPrecision() || dt.getScale() != base.getScale())) {
append(LPAREN).append(dt.getPrecision());
if (dt.getScale() != 0) {
append(COMMA).append(dt.getScale());
}
append(RPAREN);
}
if (dt.getNullType() == NullType.No_Nulls) {
append(SPACE).append(NOT_NULL);
}
append(SEMICOLON);
}
代码示例来源:origin: teiid/teiid
private void visit(Datatype dt) {
append(CREATE).append(SPACE).append(DOMAIN).append(SPACE);
append(SQLStringVisitor.escapeSinglePart(dt.getName())).append(SPACE).append(AS).append(SPACE);
String runtimeTypeName = dt.getBasetypeName();
append(runtimeTypeName);
Datatype base = SystemMetadata.getInstance().getRuntimeTypeMap().get(runtimeTypeName);
if (DataTypeManager.hasLength(runtimeTypeName)) {
if (dt.getLength() != base.getLength()) {
append(LPAREN).append(dt.getLength()).append(RPAREN);
}
} else if (PRECISION_DATATYPES.contains(runtimeTypeName)
&& (dt.getPrecision() != base.getPrecision() || dt.getScale() != base.getScale())) {
append(LPAREN).append(dt.getPrecision());
if (dt.getScale() != 0) {
append(COMMA).append(dt.getScale());
}
append(RPAREN);
}
if (dt.getNullType() == NullType.No_Nulls) {
append(SPACE).append(NOT_NULL);
}
append(SEMICOLON);
}
代码示例来源:origin: org.jboss.teiid/teiid-engine
append(runtimeTypeName);
if (LENGTH_DATATYPES.contains(runtimeTypeName)) {
if (column.getLength() != 0 && (datatype == null || column.getLength() != datatype.getLength())) {
append(LPAREN).append(column.getLength()).append(RPAREN);
代码示例来源:origin: teiid/teiid
append(runtimeTypeName);
if (DataTypeManager.hasLength(runtimeTypeName)) {
if (column.getLength() != 0 && (datatype == null || column.getLength() != datatype.getLength())) {
append(LPAREN).append(column.getLength()).append(RPAREN);
代码示例来源:origin: org.teiid/teiid-engine
append(runtimeTypeName);
if (DataTypeManager.hasLength(runtimeTypeName)) {
if (column.getLength() != 0 && (datatype == null || column.getLength() != datatype.getLength())) {
append(LPAREN).append(column.getLength()).append(RPAREN);
内容来源于网络,如有侵权,请联系作者删除!