Package org.teiid.metadata

Examples of org.teiid.metadata.Schema


        }
       
        //capabilities check is only valid for non-schema scoped functions
        //technically the other functions are scoped to SYS, but that's
        //not formally part of their metadata yet
        Schema schema = function.getFunctionDescriptor().getMethod().getParent();
        if (schema == null) {
            // Find capabilities
            SourceCapabilities caps = getCapabilities(modelID, metadata, capFinder);

            if (!caps.supportsFunction(function.getFunctionDescriptor().getName().toLowerCase())) {
                return false;
            }
        } else if (!schema.getFullName().equalsIgnoreCase(metadata.getFullName(modelID))) {
          return false; //not the right schema
        }
       
        //special check to ensure that special conversions are not pushed down (this can be removed after we support type based function pushdown)           
        if (FunctionLibrary.isConvert(function)) {
View Full Code Here


    updateModified(true, vdbName, vdbVersion, schema, tableNames);
  }
 
  private void updateModified(boolean data, String vdbName, int vdbVersion, String schema,
      String... objectNames) {
    Schema s = getSchema(vdbName, vdbVersion, schema);
    if (s == null) {
      return;
    }
    long ts = System.currentTimeMillis();
    for (String name:objectNames) {
      Table table = s.getTables().get(name);
      if (table == null) {
        continue;
      }
      if (data) {
        table.setLastDataModification(ts);
View Full Code Here

    t.setLastModified(System.currentTimeMillis());
  }

  private Table getTable(String vdbName, int vdbVersion, String schemaName,
      String tableName) {
    Schema s = getSchema(vdbName, vdbVersion, schemaName);
    if (s == null) {
      return null;
    }
    return s.getTables().get(tableName.toUpperCase());
  }
View Full Code Here

  }
 
  @Override
  public void setProcedureDefinition(String vdbName, int vdbVersion,
      String schema, String procName, String definition) {
    Schema s = getSchema(vdbName, vdbVersion, schema);
    if (s == null) {
      return;
    }
    Procedure p = s.getProcedures().get(procName.toUpperCase());
    if (p == null) {
      return;
    }
    DdlPlan.alterProcedureDefinition(this.vdbRepository.getVDB(vdbName, vdbVersion), p, definition);
  }
View Full Code Here

        TranslationHelper.loadUDFs(UDF, UTIL);
    }
   
    public static TransformationMetadata getMetadata() {
      MetadataStore store = new MetadataStore();
      Schema modeshape = RealMetadataFactory.createPhysicalModel("modeshape", store);
      Table nt_base = RealMetadataFactory.createPhysicalGroup("nt_base", modeshape);
      nt_base.setNameInSource("\"nt:base\"");
    List<Column> cols = RealMetadataFactory.createElements(nt_base, new String[] { "jcr_path",
        "mode_properties", "jcr_primaryType", "prop" }, new String[] {
        TypeFacility.RUNTIME_NAMES.STRING,
View Full Code Here

public class TestVisitors {

    public static QueryMetadataInterface exampleSalesforce() {
      MetadataStore store = new MetadataStore();
        // Create models
        Schema salesforceModel = RealMetadataFactory.createPhysicalModel("SalesforceModel", store); //$NON-NLS-1$
      
        // Create Account group
        Table accountTable = RealMetadataFactory.createPhysicalGroup("Account", salesforceModel); //$NON-NLS-1$
        accountTable.setNameInSource("Account"); //$NON-NLS-1$
        accountTable.setProperty("Supports Query", Boolean.TRUE.toString()); //$NON-NLS-1$
View Full Code Here

    }
   
    /** create fake BQT metadata to test this case, name in source is important */
    private QueryMetadataInterface getOracleSpecificMetadata() {
      MetadataStore metadataStore = new MetadataStore();
      Schema foo = RealMetadataFactory.createPhysicalModel("BQT1", metadataStore); //$NON-NLS-1$
        Table table = RealMetadataFactory.createPhysicalGroup("SmallA", foo); //$NON-NLS-1$
        Table dual = RealMetadataFactory.createPhysicalGroup("DUAL", foo); //$NON-NLS-1$
        table.setNameInSource("SmallishA");//$NON-NLS-1$
        String[] elemNames = new String[] {
            "DoubleNum"//$NON-NLS-1$
View Full Code Here

            output);       
    }
   
    @Test public void testUniqueidentifier() throws Exception {
      MetadataStore metadataStore = new MetadataStore();
      Schema foo = RealMetadataFactory.createPhysicalModel("foo", metadataStore); //$NON-NLS-1$
        Table table = RealMetadataFactory.createPhysicalGroup("bar", foo); //$NON-NLS-1$
        String[] elemNames = new String[] {
            "x"  //$NON-NLS-1$
        };
        String[] elemTypes = new String[] { 
View Full Code Here

    assertFalse(t.isVirtual());
  }
 
  @Test public void test71Schema() throws Exception {
    ObjectInputStream ois = new ObjectInputStream(new FileInputStream(UnitTestUtil.getTestDataFile("schema.ser")));
    Schema schema = (Schema) ois.readObject();
    assertNotNull(schema.getFunctions());
  }
View Full Code Here

   
    public static QueryMetadataInterface exampleLdap() {
      MetadataStore metadataStore = new MetadataStore();

        // Create models
        Schema ldapModel = RealMetadataFactory.createPhysicalModel("LdapModel", metadataStore); //$NON-NLS-1$
       
        // Create physical groups
        Table table = RealMetadataFactory.createPhysicalGroup("People", ldapModel); //$NON-NLS-1$
        table.setNameInSource("ou=people,dc=metamatrix,dc=com"); //$NON-NLS-1$
               
View Full Code Here

TOP

Related Classes of org.teiid.metadata.Schema

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.