本文整理了Java中org.teiid.metadata.Table.getProperty()
方法的一些代码示例,展示了Table.getProperty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getProperty()
方法的具体详情如下:
包路径:org.teiid.metadata.Table
类名称:Table
方法名:getProperty
暂无
代码示例来源:origin: org.teiid.connectors/translator-mongodb
public boolean isMerged() {
return this.table.getProperty(MongoDBMetadataProcessor.MERGE, false) != null;
}
代码示例来源:origin: org.teiid.connectors/translator-mongodb
public static boolean isEmbeddable(Table tbl) {
return Boolean.parseBoolean(tbl.getProperty(MongoDBMetadataProcessor.EMBEDDABLE, false));
}
代码示例来源:origin: org.teiid.connectors/translator-odata
private static String getEntityTypeName(Table t, boolean preserveEntityTypeName) {
String entityTypeName = t.getName();
if (preserveEntityTypeName && t.getProperty(ODataMetadataProcessor.ENTITY_TYPE, false) != null) {
entityTypeName = t.getProperty(ODataMetadataProcessor.ENTITY_TYPE, false);
}
return entityTypeName;
}
代码示例来源:origin: org.teiid.connectors/translator-excel
@Override
public void visit(NamedTable obj) {
this.table = obj.getMetadataObject();
this.xlsPath = this.table.getProperty(ExcelMetadataProcessor.FILE, false);
this.sheetName = this.table.getSourceName();
String firstRow = this.table.getProperty(ExcelMetadataProcessor.FIRST_DATA_ROW_NUMBER, false);
if (firstRow != null) {
// -1 make it zero based index
this.firstDataRowNumber = Integer.parseInt(firstRow)-1;
}
}
代码示例来源:origin: org.teiid.connectors/translator-odata4
static boolean isNavigationType(Table table) {
ODataType type = ODataType.valueOf(table.getProperty(ODataMetadataProcessor.ODATA_TYPE, false));
return type == ODataType.NAVIGATION || type == ODataType.NAVIGATION_COLLECTION;
}
代码示例来源:origin: org.teiid.connectors/translator-odata
Table getTableWithEntityType(Schema schema, String entityType) {
for (Table t:schema.getTables().values()) {
if (entityType.equals(t.getProperty(ODataMetadataProcessor.ENTITY_TYPE, false))) {
return t;
}
}
return null;
}
代码示例来源:origin: org.teiid.connectors/translator-odata4
static boolean isCollection(Table table) {
ODataType type = ODataType.valueOf(table.getProperty(ODataMetadataProcessor.ODATA_TYPE, false));
return type == ODataType.ENTITY_COLLECTION
|| type == ODataType.COMPLEX_COLLECTION
|| type == ODataType.NAVIGATION_COLLECTION;
}
代码示例来源:origin: org.teiid.connectors/translator-odata4
static boolean isEntitySet(Table table) {
ODataType type = ODataType.valueOf(table.getProperty(ODataMetadataProcessor.ODATA_TYPE, false));
return type == ODataType.ENTITY_COLLECTION;
}
代码示例来源:origin: org.teiid.connectors/translator-odata4
static boolean isComplexType(Table table) {
ODataType type = ODataType.valueOf(table.getProperty(ODataMetadataProcessor.ODATA_TYPE, false));
return type == ODataType.COMPLEX || type == ODataType.COMPLEX_COLLECTION;
}
代码示例来源:origin: org.teiid/teiid-runtime
public int resetPendingJob(final VDBMetaData vdb, final Table table, String nodeName){
try {
String statusTable = table.getProperty(MaterializationMetadataRepository.MATVIEW_STATUS_TABLE, false);
String updateStatusTable = "UPDATE "+statusTable+" SET LOADSTATE='NEEDS_LOADING' "
+ "WHERE LOADSTATE = 'LOADING' AND NODENAME = '"+nodeName+"' "
+ "AND NAME = '"+table.getName()+"'";
List<Map<String, String>> results = executeQuery(vdb, updateStatusTable);
String count = results.get(0).get("update-count");
return Integer.parseInt(count);
} catch (SQLException e) {
LogManager.logWarning(LogConstants.CTX_MATVIEWS, e, e.getMessage());
}
return 0;
}
代码示例来源:origin: org.teiid.connectors/translator-salesforce
@Override
public void visit(NamedTable obj) {
try {
table = obj.getMetadataObject();
String supportsQuery = table.getProperty(Constants.SUPPORTS_QUERY, true);
objectSupportsRetrieve = Boolean.valueOf(table.getProperty(Constants.SUPPORTS_RETRIEVE, true));
if (supportsQuery != null && !Boolean.valueOf(supportsQuery)) {
throw new TranslatorException(table.getSourceName() + " " + SalesForcePlugin.Util.getString("CriteriaVisitor.query.not.supported")); //$NON-NLS-1$ //$NON-NLS-2$
}
loadColumnMetadata(obj);
} catch (TranslatorException ce) {
exceptions.add(ce);
}
}
代码示例来源:origin: org.teiid.connectors/translator-salesforce
@Override
public void visit(NamedTable obj) {
//since this is hint driven we'll assume that it is used selectively
if (!allowed.contains(obj.getMetadataObject().getSourceName())
&& !Boolean.valueOf(obj.getMetadataObject().getProperty(SalesForceMetadataProcessor.TABLE_CUSTOM, false))) {
usePkChunking = false;
}
}
代码示例来源:origin: org.teiid.connectors/translator-jdbc
private boolean isTVF(TableReference table) {
if (table instanceof NamedTable) {
String value = ((NamedTable)table).getMetadataObject().getProperty(PIMetadataProcessor.TVF, false);
return Boolean.parseBoolean(value);
} else if (table instanceof NamedProcedureCall) {
String value = ((NamedProcedureCall)table).getCall().getMetadataObject().getProperty(PIMetadataProcessor.TVF, false);
return Boolean.parseBoolean(value);
}
return false;
}
代码示例来源:origin: org.teiid/teiid-runtime
@Override
public void process(Table table) {
if (table.getMaterializedTable() == null) {
return;
}
String remove = table.getProperty(MaterializationMetadataRepository.ON_VDB_DROP_SCRIPT, false);
if (remove != null) {
try {
executeQuery(vdb, remove);
} catch (SQLException e) {
LogManager.logWarning(LogConstants.CTX_MATVIEWS, e, e.getMessage());
}
}
}
});
代码示例来源:origin: org.teiid.connectors/translator-mongodb
public Table getMergeTable() throws TranslatorException {
String tblName = this.table.getProperty(MongoDBMetadataProcessor.MERGE, false);
if (tblName == null) {
return null;
}
Table mergeTable = this.metadata.getTable(this.table.getParent().getName(), tblName);
return mergeTable;
}
代码示例来源:origin: teiid/teiid
private static void removeTableOption(String key, Table table) {
if (table.getProperty(key, false) != null) {
table.setProperty(key, null);
}
removeCommonProperty(key, table);
if (key.equals(DDLConstants.MATERIALIZED)) {
table.setMaterialized(false);
}
if (key.equals(DDLConstants.MATERIALIZED_TABLE)) {
table.setMaterializedTable(null);
}
if (key.equals(DDLConstants.UPDATABLE)) {
table.setSupportsUpdate(false);
}
if (key.equals(DDLConstants.CARDINALITY)) {
table.setCardinality(-1);
}
}
代码示例来源:origin: org.teiid.connectors/translator-odata
private Table getEntityTable(MetadataFactory mf, EdmEntityType toEntity) throws TranslatorException {
for (Table t:mf.getSchema().getTables().values()) {
if (t.getProperty(ENTITY_TYPE, false).equals(toEntity.getFullyQualifiedTypeName())){
return t;
}
}
throw new TranslatorException(ODataPlugin.Util.gs(ODataPlugin.Event.TEIID17004, toEntity.getFullyQualifiedTypeName()));
}
代码示例来源:origin: teiid/teiid
@Test
public void testAlterTableModifyOptions() throws Exception {
String ddl = "CREATE FOREIGN TABLE G1( e1 integer, e2 varchar, e3 date) OPTIONS(CARDINALITY 12, FOO 'BAR');" +
"ALTER FOREIGN TABLE G1 OPTIONS(SET CARDINALITY 24);" +
"ALTER FOREIGN TABLE G1 OPTIONS(SET FOO 'BARBAR');";
Schema s = helpParse(ddl, "model").getSchema();
Map<String, Table> tableMap = s.getTables();
assertTrue("Table not found", tableMap.containsKey("G1"));
Table table = tableMap.get("G1");
assertEquals(24, table.getCardinality());
assertEquals("BARBAR", table.getProperty("FOO", false));
}
代码示例来源:origin: teiid/teiid
@Test
public void testAlterTableDropOptions() throws Exception {
String ddl = "CREATE FOREIGN TABLE G1( e1 integer, e2 varchar, e3 date) OPTIONS(CARDINALITY 12, FOO 'BAR');" +
"ALTER FOREIGN TABLE G1 OPTIONS(DROP CARDINALITY);" +
"ALTER FOREIGN TABLE G1 OPTIONS(DROP FOO);";
Schema s = helpParse(ddl, "model").getSchema();
Map<String, Table> tableMap = s.getTables();
assertTrue("Table not found", tableMap.containsKey("G1"));
Table table = tableMap.get("G1");
assertEquals(-1, table.getCardinality());
assertNull(table.getProperty("FOO", false));
}
代码示例来源:origin: teiid/teiid
@Test
public void testAlterTableAddOptions() throws Exception {
String ddl = "CREATE FOREIGN TABLE G1( e1 integer, e2 varchar, e3 date);" +
"ALTER FOREIGN TABLE G1 OPTIONS(ADD CARDINALITY 12);" +
"ALTER FOREIGN TABLE G1 OPTIONS(ADD FOO 'BAR');";
Schema s = helpParse(ddl, "model").getSchema();
Map<String, Table> tableMap = s.getTables();
assertTrue("Table not found", tableMap.containsKey("G1"));
Table table = tableMap.get("G1");
assertEquals(12, table.getCardinality());
assertEquals("BAR", table.getProperty("FOO", false));
}
内容来源于网络,如有侵权,请联系作者删除!