org.teiid.metadata.Datatype.<init>()方法的使用及代码示例

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

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

Datatype.<init>介绍

暂无

代码示例

代码示例来源:origin: org.teiid.connectors/translator-ldap

Datatype type = new Datatype();
type.setName(TypeFacility.RUNTIME_NAMES.OBJECT);
type.setJavaClassName(Object.class.getCanonicalName());

代码示例来源:origin: teiid/teiid

final Datatype dt = new Datatype();

代码示例来源:origin: org.teiid/teiid-metadata

final Datatype dt = new Datatype();

代码示例来源:origin: teiid/teiid

String[] props = s.split("\\|"); //$NON-NLS-1$
while ((s = br.readLine()) != null) {
  Datatype dt = new Datatype();
  String[] vals = s.split("\\|"); //$NON-NLS-1$
  Properties p = new Properties();

代码示例来源:origin: org.jboss.teiid/teiid-engine

String[] props = s.split("\\|"); //$NON-NLS-1$
while ((s = br.readLine()) != null) {
  Datatype dt = new Datatype();
  String[] vals = s.split("\\|"); //$NON-NLS-1$
  Properties p = new Properties();

代码示例来源:origin: org.teiid/teiid-engine

String[] props = s.split("\\|"); //$NON-NLS-1$
while ((s = br.readLine()) != null) {
  Datatype dt = new Datatype();
  String[] vals = s.split("\\|"); //$NON-NLS-1$
  Properties p = new Properties();

代码示例来源:origin: teiid/teiid

@Test public void testCorrectName() {
  ModelMetaData mmd = new ModelMetaData();
  mmd.setName("foo");
  HashMap<String, Datatype> types = new HashMap<String, Datatype>();
  Datatype value = new Datatype();
  value.setName("string");
  types.put("string", value);
  MetadataFactory factory = new MetadataFactory("x", 1, types, mmd);
  Table x = factory.addTable("x");
  Column c = factory.addColumn("a.b", "string", x);
  assertEquals("a_b", c.getName());
}

代码示例来源:origin: teiid/teiid

private TransformationMetadata exampleTransformationMetadata()
    throws TranslatorException {
  Map<String, Datatype> datatypes = new HashMap<String, Datatype>();
  Datatype dt = new Datatype();
  dt.setName(DataTypeManager.DefaultDataTypes.STRING);
  dt.setJavaClassName(String.class.getCanonicalName());

代码示例来源:origin: teiid/teiid

@Test public void testDuplicateColumns() {
  ModelMetaData mmd = new ModelMetaData();
  mmd.setName("foo");
  mmd.addProperty("importer.renameDuplicateColumns", "true");
  HashMap<String, Datatype> types = new HashMap<String, Datatype>();
  Datatype value = new Datatype();
  value.setName("string");
  types.put("string", value);
  MetadataFactory factory = new MetadataFactory("x", 1, types, mmd);
  Table x = factory.addTable("x");
  Column c = factory.addColumn("a_b", "string", x);
  assertEquals("a_b", c.getName());
  c = factory.addColumn("a_B", "string", x);
  assertEquals("a_B_1", c.getName());
}

代码示例来源:origin: teiid/teiid

@Test public void testDuplicateProcedure() {
  ModelMetaData mmd = new ModelMetaData();
  mmd.setName("foo");
  mmd.addProperty("importer.renameAllDuplicates", "true");
  HashMap<String, Datatype> types = new HashMap<String, Datatype>();
  Datatype value = new Datatype();
  value.setName("string");
  types.put("string", value);
  MetadataFactory factory = new MetadataFactory("x", 1, types, mmd);
  Procedure x = factory.addProcedure("x");
  assertEquals("x", x.getName());
  Procedure x1 = factory.addProcedure("X");
  assertEquals("X_1", x1.getName());
  Procedure x2 = factory.addProcedure("X");
  assertEquals("X_2", x2.getName());
}

代码示例来源:origin: teiid/teiid

@Test public void testAmbiguousTableWithPrivateModel() throws Exception {
  Map<String, Datatype> datatypes = new HashMap<String, Datatype>();
  Datatype dt = new Datatype();
  dt.setName(DataTypeManager.DefaultDataTypes.STRING);
  dt.setJavaClassName(String.class.getCanonicalName());

代码示例来源:origin: teiid/teiid

@Test public void testDuplicateTables() {
  ModelMetaData mmd = new ModelMetaData();
  mmd.setName("foo");
  mmd.addProperty("importer.renameDuplicateTables", "true");
  HashMap<String, Datatype> types = new HashMap<String, Datatype>();
  Datatype value = new Datatype();
  value.setName("string");
  types.put("string", value);
  MetadataFactory factory = new MetadataFactory("x", 1, types, mmd);
  Table x = factory.addTable("x");
  assertEquals("x", x.getName());
  Table x1 = factory.addTable("X");
  assertEquals("X_1", x1.getName());
  Table x2 = factory.addTable("X");
  assertEquals("X_2", x2.getName());
}

代码示例来源:origin: teiid/teiid

@Test public void testColumnPrecisionScale() {
  Column c = new Column();
  Datatype datatype = new Datatype();
  datatype.setName("bigdecimal");
  c.setDatatype(datatype);
  c.setPrecision(0);
  c.setScale(2);
  assertEquals(2, c.getScale());
  assertEquals(BaseColumn.DEFAULT_PRECISION, c.getPrecision());
}

代码示例来源:origin: teiid/teiid

@Test public void testTypeCorrection() throws Exception {
  MetadataFactory mf = new MetadataFactory(null, 1, "x", SystemMetadata.getInstance().getRuntimeTypeMap(), new Properties(), null); //$NON-NLS-1$
  
  Table t = mf.addTable("y"); //$NON-NLS-1$
  mf.addColumn("test", "string", t);
  mf.addColumn("array", "string[]", t);
  Datatype unknown = new Datatype();
  unknown.setName("unknown");
  Column col = mf.addColumn("arg", "string", t);
  col.setDatatype(unknown, false, 0);
  MetadataFactory mf1 = UnitTestUtil.helpSerialize(mf);
  
  Column column = mf1.getSchema().getTable("y").getColumns().get(0);
  Datatype dt = column.getDatatype();
  
  assertNotSame(mf.getDataTypes().get(dt.getName()), column.getDatatype());
  
  assertEquals(1, mf1.getSchema().getTable("y").getColumns().get(1).getArrayDimensions());
  
  mf1.correctDatatypes(mf.getDataTypes());
  
  assertSame(mf.getDataTypes().get(dt.getName()), column.getDatatype());
  
  assertEquals(1, mf1.getSchema().getTable("y").getColumns().get(1).getArrayDimensions());
}

相关文章