org.teiid.metadata.Table.setName()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(234)

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

Table.setName介绍

暂无

代码示例

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

  1. private static void setTableOptions(Table table) {
  2. Map<String, String> props = table.getProperties();
  3. setCommonProperties(table, props);
  4. String value = props.remove(DDLConstants.MATERIALIZED);
  5. if (value != null) {
  6. table.setMaterialized(isTrue(value));
  7. }
  8. value = props.remove(DDLConstants.MATERIALIZED_TABLE);
  9. if (value != null) {
  10. Table mattable = new Table();
  11. mattable.setName(value);
  12. table.setMaterializedTable(mattable);
  13. }
  14. value = props.remove(DDLConstants.UPDATABLE);
  15. if (value != null) {
  16. table.setSupportsUpdate(isTrue(value));
  17. }
  18. value = props.remove(DDLConstants.CARDINALITY);
  19. if (value != null) {
  20. table.setCardinality(Long.valueOf(value));
  21. }
  22. }

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

  1. /**
  2. * Create a physical group with default settings.
  3. * @param name Name of physical group, must match model name
  4. * @param model Associated model
  5. * @return FakeMetadataObject Metadata object for group
  6. */
  7. public static Table createPhysicalGroup(String name, Schema model, boolean fullyQualify) {
  8. Table table = new Table();
  9. table.setName(name);
  10. model.addTable(table);
  11. table.setSupportsUpdate(true);
  12. table.setNameInSource((fullyQualify || name.lastIndexOf(".") == -1)? name : name.substring(name.lastIndexOf(".") + 1)); //$NON-NLS-1$ //$NON-NLS-2$
  13. table.setTableType(org.teiid.metadata.Table.Type.Table);
  14. return table;
  15. }

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

  1. private static void setTableOptions(Table table) {
  2. Map<String, String> props = table.getProperties();
  3. setCommonProperties(table, props);
  4. String value = props.remove(DDLConstants.MATERIALIZED);
  5. if (value != null) {
  6. table.setMaterialized(isTrue(value));
  7. }
  8. value = props.remove(DDLConstants.MATERIALIZED_TABLE);
  9. if (value != null) {
  10. Table mattable = new Table();
  11. mattable.setName(value);
  12. table.setMaterializedTable(mattable);
  13. }
  14. value = props.remove(DDLConstants.UPDATABLE);
  15. if (value != null) {
  16. table.setSupportsUpdate(isTrue(value));
  17. }
  18. value = props.remove(DDLConstants.CARDINALITY);
  19. if (value != null) {
  20. table.setCardinality(Long.valueOf(value));
  21. }
  22. }

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

  1. private static void setTableOptions(Table table) {
  2. Map<String, String> props = table.getProperties();
  3. setCommonProperties(table, props);
  4. String value = props.remove(DDLConstants.MATERIALIZED);
  5. if (value != null) {
  6. table.setMaterialized(isTrue(value));
  7. }
  8. value = props.remove(DDLConstants.MATERIALIZED_TABLE);
  9. if (value != null) {
  10. Table mattable = new Table();
  11. mattable.setName(value);
  12. table.setMaterializedTable(mattable);
  13. }
  14. value = props.remove(DDLConstants.UPDATABLE);
  15. if (value != null) {
  16. table.setSupportsUpdate(isTrue(value));
  17. }
  18. value = props.remove(DDLConstants.CARDINALITY);
  19. if (value != null) {
  20. table.setCardinality(Long.valueOf(value));
  21. }
  22. }

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

  1. public void modifyTableName(String name, Database.ResourceType type, String newName) {
  2. if (!assertInEditMode(Mode.SCHEMA)) {
  3. return;
  4. }
  5. Table table = (Table)getSchemaRecord(name, type);
  6. assertGrant(Grant.Permission.Privilege.ALTER, Database.ResourceType.TABLE, table);
  7. Schema s = table.getParent();
  8. if (s.getTable(newName) != null) {
  9. throw new DuplicateRecordException(DataPlugin.Event.TEIID60013, DataPlugin.Util.gs(DataPlugin.Event.TEIID60013, newName));
  10. }
  11. s.getTables().remove(table.getName());
  12. table.setName(newName);
  13. s.getTables().put(newName, table);
  14. }

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

  1. public void modifyTableName(String name, Database.ResourceType type, String newName) {
  2. if (!assertInEditMode(Mode.SCHEMA)) {
  3. return;
  4. }
  5. Table table = (Table)getSchemaRecord(name, type);
  6. assertGrant(Grant.Permission.Privilege.ALTER, Database.ResourceType.TABLE, table);
  7. Schema s = table.getParent();
  8. if (s.getTable(newName) != null) {
  9. throw new DuplicateRecordException(DataPlugin.Event.TEIID60013, DataPlugin.Util.gs(DataPlugin.Event.TEIID60013, newName));
  10. }
  11. s.getTables().remove(table.getName());
  12. table.setName(newName);
  13. s.getTables().put(newName, table);
  14. }

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

  1. /**
  2. * Add a table with the given name to the model.
  3. * @param name
  4. * @return
  5. * @throws MetadataException
  6. */
  7. public Table addTable(String name) {
  8. Table table = new Table();
  9. table.setTableType(Table.Type.Table);
  10. if (nameFormat != null) {
  11. name = String.format(nameFormat, name);
  12. }
  13. if (renameAllDuplicates || renameDuplicateTables) {
  14. name = checkForDuplicate(name, (s)->this.schema.getTable(s) != null, "Table"); //$NON-NLS-1$
  15. }
  16. table.setName(name);
  17. setUUID(table);
  18. this.schema.addTable(table);
  19. table.setVirtual(!this.schema.isPhysical());
  20. return table;
  21. }

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

  1. /**
  2. * Create a virtual group with default settings.
  3. */
  4. public static Table createVirtualGroup(String name, Schema model, QueryNode plan) {
  5. Table table = new Table();
  6. table.setName(name);
  7. model.addTable(table);
  8. table.setVirtual(true);
  9. table.setTableType(org.teiid.metadata.Table.Type.View);
  10. table.setSelectTransformation(plan.getQuery());
  11. return table;
  12. }

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

  1. table.setName(tableName);
  2. createTableBody(table, factory);
  3. jj_consume_token(ON);

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

  1. table.setName(tableName);
  2. createTableBody(table, factory);
  3. jj_consume_token(ON);

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

  1. table.setName(tableName);
  2. createTableBody(table, factory);
  3. jj_consume_token(ON);

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

  1. @Test public void testForeignTemp() {
  2. Create create = new Create();
  3. create.setTable(new GroupSymbol("tempTable")); //$NON-NLS-1$
  4. create.setOn("source");
  5. Table t = new Table();
  6. t.setName("tempTable");
  7. t.setUUID("tid:0");
  8. Column c = new Column();
  9. c.setName("x");
  10. c.setUUID("tid:0");
  11. Datatype string = SystemMetadata.getInstance().getRuntimeTypeMap().get("string");
  12. c.setDatatype(string, true, 0);
  13. t.addColumn(c);
  14. c = new Column();
  15. c.setName("y");
  16. c.setUUID("tid:0");
  17. Datatype decimal = SystemMetadata.getInstance().getRuntimeTypeMap().get("decimal");
  18. c.setDatatype(decimal, true, 0);
  19. t.addColumn(c);
  20. t.setCardinality(10000);
  21. create.setTableMetadata(t);
  22. helpTest("create foreign temporary table tempTable (x string, y decimal) options (cardinality 10000) on source", "CREATE FOREIGN TEMPORARY TABLE tempTable (\n x string,\n y bigdecimal\n) OPTIONS (CARDINALITY 10000) ON 'source'", create); //$NON-NLS-1$ //$NON-NLS-2$
  23. }

相关文章