本文整理了Java中org.teiid.metadata.Table.setName()
方法的一些代码示例,展示了Table.setName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.setName()
方法的具体详情如下:
包路径:org.teiid.metadata.Table
类名称:Table
方法名:setName
暂无
代码示例来源:origin: org.teiid/teiid-engine
private static void setTableOptions(Table table) {
Map<String, String> props = table.getProperties();
setCommonProperties(table, props);
String value = props.remove(DDLConstants.MATERIALIZED);
if (value != null) {
table.setMaterialized(isTrue(value));
}
value = props.remove(DDLConstants.MATERIALIZED_TABLE);
if (value != null) {
Table mattable = new Table();
mattable.setName(value);
table.setMaterializedTable(mattable);
}
value = props.remove(DDLConstants.UPDATABLE);
if (value != null) {
table.setSupportsUpdate(isTrue(value));
}
value = props.remove(DDLConstants.CARDINALITY);
if (value != null) {
table.setCardinality(Long.valueOf(value));
}
}
代码示例来源:origin: teiid/teiid
/**
* Create a physical group with default settings.
* @param name Name of physical group, must match model name
* @param model Associated model
* @return FakeMetadataObject Metadata object for group
*/
public static Table createPhysicalGroup(String name, Schema model, boolean fullyQualify) {
Table table = new Table();
table.setName(name);
model.addTable(table);
table.setSupportsUpdate(true);
table.setNameInSource((fullyQualify || name.lastIndexOf(".") == -1)? name : name.substring(name.lastIndexOf(".") + 1)); //$NON-NLS-1$ //$NON-NLS-2$
table.setTableType(org.teiid.metadata.Table.Type.Table);
return table;
}
代码示例来源:origin: teiid/teiid
private static void setTableOptions(Table table) {
Map<String, String> props = table.getProperties();
setCommonProperties(table, props);
String value = props.remove(DDLConstants.MATERIALIZED);
if (value != null) {
table.setMaterialized(isTrue(value));
}
value = props.remove(DDLConstants.MATERIALIZED_TABLE);
if (value != null) {
Table mattable = new Table();
mattable.setName(value);
table.setMaterializedTable(mattable);
}
value = props.remove(DDLConstants.UPDATABLE);
if (value != null) {
table.setSupportsUpdate(isTrue(value));
}
value = props.remove(DDLConstants.CARDINALITY);
if (value != null) {
table.setCardinality(Long.valueOf(value));
}
}
代码示例来源:origin: org.jboss.teiid/teiid-engine
private static void setTableOptions(Table table) {
Map<String, String> props = table.getProperties();
setCommonProperties(table, props);
String value = props.remove(DDLConstants.MATERIALIZED);
if (value != null) {
table.setMaterialized(isTrue(value));
}
value = props.remove(DDLConstants.MATERIALIZED_TABLE);
if (value != null) {
Table mattable = new Table();
mattable.setName(value);
table.setMaterializedTable(mattable);
}
value = props.remove(DDLConstants.UPDATABLE);
if (value != null) {
table.setSupportsUpdate(isTrue(value));
}
value = props.remove(DDLConstants.CARDINALITY);
if (value != null) {
table.setCardinality(Long.valueOf(value));
}
}
代码示例来源:origin: org.teiid/teiid-engine
public void modifyTableName(String name, Database.ResourceType type, String newName) {
if (!assertInEditMode(Mode.SCHEMA)) {
return;
}
Table table = (Table)getSchemaRecord(name, type);
assertGrant(Grant.Permission.Privilege.ALTER, Database.ResourceType.TABLE, table);
Schema s = table.getParent();
if (s.getTable(newName) != null) {
throw new DuplicateRecordException(DataPlugin.Event.TEIID60013, DataPlugin.Util.gs(DataPlugin.Event.TEIID60013, newName));
}
s.getTables().remove(table.getName());
table.setName(newName);
s.getTables().put(newName, table);
}
代码示例来源:origin: teiid/teiid
public void modifyTableName(String name, Database.ResourceType type, String newName) {
if (!assertInEditMode(Mode.SCHEMA)) {
return;
}
Table table = (Table)getSchemaRecord(name, type);
assertGrant(Grant.Permission.Privilege.ALTER, Database.ResourceType.TABLE, table);
Schema s = table.getParent();
if (s.getTable(newName) != null) {
throw new DuplicateRecordException(DataPlugin.Event.TEIID60013, DataPlugin.Util.gs(DataPlugin.Event.TEIID60013, newName));
}
s.getTables().remove(table.getName());
table.setName(newName);
s.getTables().put(newName, table);
}
代码示例来源:origin: teiid/teiid
/**
* Add a table with the given name to the model.
* @param name
* @return
* @throws MetadataException
*/
public Table addTable(String name) {
Table table = new Table();
table.setTableType(Table.Type.Table);
if (nameFormat != null) {
name = String.format(nameFormat, name);
}
if (renameAllDuplicates || renameDuplicateTables) {
name = checkForDuplicate(name, (s)->this.schema.getTable(s) != null, "Table"); //$NON-NLS-1$
}
table.setName(name);
setUUID(table);
this.schema.addTable(table);
table.setVirtual(!this.schema.isPhysical());
return table;
}
代码示例来源:origin: teiid/teiid
/**
* Create a virtual group with default settings.
*/
public static Table createVirtualGroup(String name, Schema model, QueryNode plan) {
Table table = new Table();
table.setName(name);
model.addTable(table);
table.setVirtual(true);
table.setTableType(org.teiid.metadata.Table.Type.View);
table.setSelectTransformation(plan.getQuery());
return table;
}
代码示例来源:origin: teiid/teiid
table.setName(tableName);
createTableBody(table, factory);
jj_consume_token(ON);
代码示例来源:origin: org.jboss.teiid/teiid-engine
table.setName(tableName);
createTableBody(table, factory);
jj_consume_token(ON);
代码示例来源:origin: org.teiid/teiid-engine
table.setName(tableName);
createTableBody(table, factory);
jj_consume_token(ON);
代码示例来源:origin: teiid/teiid
@Test public void testForeignTemp() {
Create create = new Create();
create.setTable(new GroupSymbol("tempTable")); //$NON-NLS-1$
create.setOn("source");
Table t = new Table();
t.setName("tempTable");
t.setUUID("tid:0");
Column c = new Column();
c.setName("x");
c.setUUID("tid:0");
Datatype string = SystemMetadata.getInstance().getRuntimeTypeMap().get("string");
c.setDatatype(string, true, 0);
t.addColumn(c);
c = new Column();
c.setName("y");
c.setUUID("tid:0");
Datatype decimal = SystemMetadata.getInstance().getRuntimeTypeMap().get("decimal");
c.setDatatype(decimal, true, 0);
t.addColumn(c);
t.setCardinality(10000);
create.setTableMetadata(t);
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$
}
内容来源于网络,如有侵权,请联系作者删除!