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

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

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

Table.setProperty介绍

暂无

代码示例

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

private Table addTable(MetadataFactory mf, String tableName,
    String entityType, ODataType odataType, XMLMetadata metadata) 
    throws TranslatorException {
  Table table = buildTable(mf, tableName);
  table.setProperty(ODATA_TYPE, odataType.name());
  table.setProperty(NAME_IN_SCHEMA, entityType);
  
  CsdlEntityType type = getEntityType(metadata, entityType);
  addEntityTypeProperties(mf, metadata, table, type);
  return table;
}

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

private void addTable(DescribeGlobalSObjectResult objectMetadata) {
  String name = objectMetadata.getName();
  if (normalizeNames) {
    name = NameUtil.normalizeName(name);
  }
  if (!allowedToAdd(name)) {
    return;
  }
  Table table = metadataFactory.addTable(name);
  FullyQualifiedName fqn = new FullyQualifiedName("sobject", objectMetadata.getName()); //$NON-NLS-1$
  table.setProperty(FQN, fqn.toString());
  table.setNameInSource(objectMetadata.getName());
  tableMap.put(objectMetadata.getName(), table);
  
  table.setProperty(TABLE_CUSTOM, String.valueOf(objectMetadata.isCustom()));
  table.setProperty(TABLE_SUPPORTS_CREATE, String.valueOf(objectMetadata.isCreateable()));
  table.setProperty(TABLE_SUPPORTS_DELETE, String.valueOf(objectMetadata.isDeletable()));
  table.setProperty(TABLE_SUPPORTS_MERGE, String.valueOf(objectMetadata.isMergeable()));
  table.setProperty(TABLE_SUPPORTS_QUERY, String.valueOf(objectMetadata.isQueryable()));
  table.setProperty(TABLE_SUPPORTS_REPLICATE, String.valueOf(objectMetadata.isReplicateable()));
  table.setProperty(TABLE_SUPPORTS_RETRIEVE, String.valueOf(objectMetadata.isRetrieveable()));
  table.setProperty(TABLE_SUPPORTS_SEARCH, String.valueOf(objectMetadata.isSearchable()));
}

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

table.setProperty(TYPE, ti.type); 
tableMap.put(fullName, ti);
tableMap.put(tableName, ti);

代码示例来源: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.jboss.teiid/teiid-engine

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/teiid-engine

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.jboss.teiid/teiid-engine

try {
  parser.parseCommand(wrapped);
  table.setProperty(property, wrapped);
  return wrapped;
} catch (QueryParserException e) {
try {
  parser.parseCommand(wrapped);
  table.setProperty(property, wrapped);
  return wrapped;
} catch (QueryParserException e) {

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

try {
  parser.parseCommand(wrapped);
  table.setProperty(property, wrapped);
  return wrapped;
} catch (QueryParserException e) {
try {
  parser.parseCommand(wrapped);
  table.setProperty(property, wrapped);
  return wrapped;
} catch (QueryParserException e) {

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

try {
  parser.parseCommand(wrapped);
  table.setProperty(property, wrapped);
  return wrapped;
} catch (QueryParserException e) {
try {
  parser.parseCommand(wrapped);
  table.setProperty(property, wrapped);
  return wrapped;
} catch (QueryParserException e) {

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

@BeforeClass public static void oneTimeSetup() throws Exception {
  tm = RealMetadataFactory.example1();
  Table t = tm.getGroupID("pm1.g1");
  t.setProperty(RulePlaceAccess.CONFORMED_SOURCES, "pm2");
  t = tm.getGroupID("pm2.g3");
  t.setProperty(RulePlaceAccess.CONFORMED_SOURCES, "pm1");
  t = tm.getGroupID("pm2.g1");
  t.setProperty(RulePlaceAccess.CONFORMED_SOURCES, "pm3");
}

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

private Table addEntity(MetadataFactory mf, Metamodel model, EntityType<?> entity) throws TranslatorException {
  Table table = mf.getSchema().getTable(entity.getName());
  if (table == null) {			
    table = mf.addTable(entity.getName());
    table.setSupportsUpdate(true);
    table.setProperty(ENTITYCLASS, entity.getJavaType().getCanonicalName());
    addPrimaryKey(mf, model, entity, table);
    addSingularAttributes(mf, model, entity, table, Collections.EMPTY_LIST);
  }
  return table;
}

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

public void getConnectorMetadata(Connection conn, MetadataFactory metadataFactory)
      throws SQLException {
    super.getConnectorMetadata(conn, metadataFactory);
    for (String name:metadataFactory.getSchema().getTables().keySet()) {
      if (name.startsWith("ft_")) {
        Table table = metadataFactory.getSchema().getTable(name);
        table.setProperty(TVF, "true");
      }
    }
    for (String name:metadataFactory.getSchema().getProcedures().keySet()) {
      Procedure proc = metadataFactory.getSchema().getProcedure(name);
      proc.setProperty(TVF, "true");
    }         
  }
}

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

FullyQualifiedName rn = new FullyQualifiedName("embedded", tableName); //$NON-NLS-1$
  String parentfqn = parent.getProperty(FQN, false);
  table.setProperty(FQN, parentfqn + FullyQualifiedName.SEPARATOR + rn.toString());
} else {
  FullyQualifiedName fqn = new FullyQualifiedName("collection", tableName); //$NON-NLS-1$
  table.setProperty(FQN, fqn.toString());

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

private Table add_matpg_datatype()  {
  Table t = createView("matpg_datatype"); //$NON-NLS-1$ 
  addColumn("oid", DataTypeManager.DefaultDataTypes.INTEGER, t); //$NON-NLS-1$
  addColumn("typname", DataTypeManager.DefaultDataTypes.STRING, t); //$NON-NLS-1$ 
  addColumn("name", DataTypeManager.DefaultDataTypes.STRING, t); //$NON-NLS-1$ 
  addColumn("typlen", DataTypeManager.DefaultDataTypes.SHORT, t); //$NON-NLS-1$
  addColumn("typtype", DataTypeManager.DefaultDataTypes.CHAR, t); //$NON-NLS-1$
  addColumn("typbasetype", DataTypeManager.DefaultDataTypes.INTEGER, t); //$NON-NLS-1$
  addColumn("typtypmod", DataTypeManager.DefaultDataTypes.INTEGER, t); //$NON-NLS-1$
  
  addPrimaryKey("matpg_datatype_names", Arrays.asList("oid", "name"), t); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 
  addIndex("matpg_datatype_ids", true, Arrays.asList("typname", "oid"), t); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 
  String transformation = "select pt.oid as oid, pt.typname as typname, pt.teiid_name as name, pt.typlen, pt.typtype, pt.typbasetype, pt.typtypmod from pg_catalog.pg_type pt" //$NON-NLS-1$
      + " UNION ALL select pt.oid as oid, pt.typname as typname, 'char' as name, pt.typlen, pt.typtype, pt.typbasetype, pt.typtypmod from pg_catalog.pg_type pt where typname='bpchar'" //$NON-NLS-1$
      + " UNION ALL select pt.oid as oid, pt.typname as typname, 'byte' as name, pt.typlen, pt.typtype, pt.typbasetype, pt.typtypmod from pg_catalog.pg_type pt where typname='int2'" //$NON-NLS-1$
      + " UNION ALL select pt.oid as oid, pt.typname as typname, 'biginteger' as name, pt.typlen, pt.typtype, pt.typbasetype, pt.typtypmod from pg_catalog.pg_type pt where typname='numeric'"  //$NON-NLS-1$
      + " UNION ALL select pt.oid as oid, pt.typname as typname, 'varbinary' as name, pt.typlen, pt.typtype, pt.typbasetype, pt.typtypmod from pg_catalog.pg_type pt where typname='bytea'"  //$NON-NLS-1$
      + " UNION ALL select pt.oid as oid, pt.typname as typname, 'byte[]' as name, pt.typlen, pt.typtype, pt.typbasetype, pt.typtypmod from pg_catalog.pg_type pt where typname='_int2'" //$NON-NLS-1$
      + " UNION ALL select pt.oid as oid, pt.typname as typname, 'biginteger[]' as name, pt.typlen, pt.typtype, pt.typbasetype, pt.typtypmod from pg_catalog.pg_type pt where typname='_numeric'"  //$NON-NLS-1$
      + " UNION ALL select pt.oid as oid, pt.typname as typname, 'varbinary[]' as name, pt.typlen, pt.typtype, pt.typbasetype, pt.typtypmod from pg_catalog.pg_type pt where typname='_bytea'"  //$NON-NLS-1$
      + " UNION ALL select pt.oid as oid, pt.typname as typname, 'char[]' as name, pt.typlen, pt.typtype, pt.typbasetype, pt.typtypmod from pg_catalog.pg_type pt where typname='_bpchar'"; //$NON-NLS-1$
  t.setSelectTransformation(transformation);
  t.setMaterialized(true);
  t.setProperty(MaterializationMetadataRepository.ALLOW_MATVIEW_MANAGEMENT, "true"); //$NON-NLS-1$
  return t;
}

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

/**
 * 
 * @param metadataFactory
 * @param tableCatalog
 * @param tableSchema
 * @param tableName
 * @param remarks
 * @param fullName
 * @return
 */
protected Table addTable(MetadataFactory metadataFactory,
    String tableCatalog, String tableSchema, String tableName,
    String remarks, String fullName) {
  Table table = metadataFactory.addTable(useFullSchemaName?fullName:tableName);
  table.setNameInSource(getFullyQualifiedName(tableCatalog, tableSchema, tableName, true));
  //create a fqn for the table
  FullyQualifiedName fqn = new FullyQualifiedName();
  if (tableCatalog != null && !tableCatalog.isEmpty()) {
    fqn.append(getCatalogTerm(), tableCatalog);
  }
  if (tableSchema != null && !tableSchema.isEmpty()) {
    fqn.append(getSchemaTerm(), tableSchema);
  }
  fqn.append(getTableTerm(), tableName); 
  table.setProperty(FQN, fqn.toString());
  table.setSupportsUpdate(true);
  table.setAnnotation(remarks);
  return table;
}

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

/**
 * Adds new table to metadata.
 * 
 * @param spreadsheet  Name of the spreadsheet
 * @param worksheet    Name of the worksheet
 * @throws TranslatorException
 */
private void addTable(MetadataFactory mf, Worksheet worksheet) {
  if (worksheet.getColumnCount() == 0){
    return;
  }
  Table table = mf.addTable(worksheet.getName());
  table.setProperty(FQN, new FullyQualifiedName("worksheet", worksheet.getName()).toString()); //$NON-NLS-1$
  table.setNameInSource(worksheet.getName()); 
  if (worksheet.isHeaderEnabled()) {
    table.setSupportsUpdate(true);
  }
  addColumnsToTable(mf, table, worksheet);
}

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

private void addForeignKey(MetadataFactory metadataFactory, Table childTable, Table table) {
  MergeDetails.Association association = MergeDetails.Association.valueOf(childTable.getProperty(ASSOSIATION, false));
  childTable.setProperty(ASSOSIATION, null);
  if (association == MergeDetails.Association.ONE) {
    KeyRecord record = table.getPrimaryKey();

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

t.setProperty(DataModifiable.DATA_TTL, "2");
ai.addAccessedObject(t);

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

FullyQualifiedName fqn = new FullyQualifiedName("entity container", container.getName()==null?"default":container.getName()); //$NON-NLS-1$ //$NON-NLS-2$
fqn.append("entity set", entitySet.getName()); //$NON-NLS-1$
t.setProperty(FQN, fqn.toString());
FullyQualifiedName fqn = new FullyQualifiedName("entity container", container.getName()==null?"default":container.getName()); //$NON-NLS-1$ //$NON-NLS-2$
fqn.append("singleton", singleton.getName()); //$NON-NLS-1$
t.setProperty(FQN, fqn.toString());

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

protected Table addEntitySetAsTable(MetadataFactory mf, EdmEntitySet entitySet) throws TranslatorException {
  Table table = buildTable(mf, entitySet);
  table.setProperty(ENTITY_TYPE, entitySet.getType().getFullyQualifiedTypeName());

相关文章

微信公众号

最新文章

更多