Examples of MetaDataFactory


Examples of org.apache.openjpa.meta.MetaDataFactory

     * create a new repository and sets it.
     */
    public MetaDataRepository getRepository() {
        if (_repos == null) {
            MetaDataRepository repos = _conf.newMetaDataRepositoryInstance();
            MetaDataFactory mdf = repos.getMetaDataFactory();
            if (mdf instanceof DelegatingMetaDataFactory)
                mdf = ((DelegatingMetaDataFactory) mdf).getInnermostDelegate();
            if (mdf instanceof PersistenceMetaDataFactory)
                ((PersistenceMetaDataFactory) mdf).setAnnotationParser(this);
            _repos = repos;
View Full Code Here

Examples of org.apache.openjpa.meta.MetaDataFactory

    /**
     * Tell the metadata factory to load object id classes even if they don't
     * exist.
     */
    private static void loadObjectIds(MetaDataRepository repos, boolean fatal) {
        MetaDataFactory mdf = repos.getMetaDataFactory();
        if (mdf instanceof DelegatingMetaDataFactory)
            mdf = ((DelegatingMetaDataFactory) mdf).getInnermostDelegate();
        if (mdf instanceof ObjectIdLoader)
            ((ObjectIdLoader) mdf).setLoadObjectIds();
        else if (fatal)
View Full Code Here

Examples of org.jpox.metadata.MetaDataFactory

        if (!StringUtils.isWhitespace(metadataFactory))
        {
            try
            {
                Class factoryCls = clr.classForName(metadataFactory,Enhancer.class.getClassLoader());
                MetaDataFactory factory = (MetaDataFactory)ClassUtils.newInstance(factoryCls,
                    new Class[] {MetaDataManager.class}, new Object[] {omfContext.getMetaDataManager()});
                omfContext.getMetaDataManager().setMetaDataFactory(factory);
            }
            catch (Exception e)
            {
View Full Code Here

Examples of org.jpox.metadata.MetaDataFactory

        if (!StringUtils.isWhitespace(metadataFactory))
        {
            try
            {
                Class factoryCls = clr.classForName(metadataFactory);
                MetaDataFactory factory = (MetaDataFactory)ClassUtils.newInstance(factoryCls,
                    new Class[] {MetaDataManager.class}, new Object[] {metaDataMgr});
                metaDataMgr.setMetaDataFactory(factory);
            }
            catch (Exception e)
            {
View Full Code Here

Examples of org.teiid.metadata.MetadataFactory

  private TransformationMetadata exampleTransformationMetadata()
      throws TranslatorException {
    Map<String, Datatype> datatypes = new HashMap<String, Datatype>();
        datatypes.put(DataTypeManager.DefaultDataTypes.STRING, new Datatype());
    MetadataFactory mf = new MetadataFactory("x", datatypes, new Properties()); //$NON-NLS-1$
    mf.addProcedure("y"); //$NON-NLS-1$
   
    Table t = mf.addTable("foo");
    mf.addColumn("col", DataTypeManager.DefaultDataTypes.STRING, t);
   
    MetadataFactory mf1 = new MetadataFactory("x1", datatypes, new Properties()); //$NON-NLS-1$
    mf1.addProcedure("y"); //$NON-NLS-1$
   
    Table table = mf1.addTable("doc");
    table.setSchemaPaths(Arrays.asList("../../x.xsd"));
    table.setResourcePath("/a/b/doc.xmi");
   
    HashMap<String, Resource> resources = new HashMap<String, Resource>();
    resources.put("/x.xsd", new Resource(Mockito.mock(VirtualFile.class), true));
   
    CompositeMetadataStore cms = new CompositeMetadataStore(Arrays.asList(mf.getMetadataStore(), mf1.getMetadataStore()));
   
    VDBMetaData vdb = new VDBMetaData();
    vdb.setName("vdb");
    vdb.setVersion(1);
   
View Full Code Here

Examples of org.teiid.metadata.MetadataFactory

  }
 
  @Test public void testAmbiguousTableWithPrivateModel() throws Exception {
    Map<String, Datatype> datatypes = new HashMap<String, Datatype>();
        datatypes.put(DataTypeManager.DefaultDataTypes.STRING, new Datatype());
    MetadataFactory mf = new MetadataFactory("x", datatypes, new Properties()); //$NON-NLS-1$
    mf.addTable("y"); //$NON-NLS-1$
    MetadataFactory mf1 = new MetadataFactory("x1", datatypes, new Properties()); //$NON-NLS-1$
    mf1.addTable("y"); //$NON-NLS-1$
    CompositeMetadataStore cms = new CompositeMetadataStore(Arrays.asList(mf.getMetadataStore(), mf1.getMetadataStore()));
   
    VDBMetaData vdb = new VDBMetaData();
    vdb.setName("foo");
    vdb.setVersion(1);
   
View Full Code Here

Examples of org.teiid.metadata.MetadataFactory

      }
      return sb.toString();
    }
   
    public MetadataStore getMetadata(String modelName, Map<String, Datatype> datatypes, Properties importProperties) throws TranslatorException {
    MetadataFactory factory = new MetadataFactory(modelName, datatypes, importProperties);
    Object connectionFactory = getConnectionFactory();
    Object connection = executionFactory.getConnection(connectionFactory);
    Object unwrapped = null;
   
    if (connection instanceof WrappedConnection) {
      try {
        unwrapped = ((WrappedConnection)connection).unwrap();
      } catch (ResourceException e) {
        throw new TranslatorException(QueryPlugin.Util.getString("failed_to_unwrap_connection")); //$NON-NLS-1$
     
    }
   
    try {
      executionFactory.getMetadata(factory, (unwrapped == null) ? connection:unwrapped);
    } finally {
      executionFactory.closeConnection(connection, connectionFactory);
    }
    return factory.getMetadataStore();
  }   
View Full Code Here

Examples of org.teiid.metadata.MetadataFactory

@SuppressWarnings("nls")
public class TestDymamicImportedMetaData {

  private MetadataFactory getMetadata(Properties importProperties, Connection conn)
      throws TranslatorException {
    MetadataFactory mf = createMetadataFactory("test", importProperties);
     
      TeiidExecutionFactory tef = new TeiidExecutionFactory();
      tef.getMetadata(mf, conn);
      return mf;
  }
View Full Code Here

Examples of org.teiid.metadata.MetadataFactory

  }

  private MetadataFactory createMetadataFactory(String schema, Properties importProperties) {
    VDBRepository vdbRepository = new VDBRepository();
      vdbRepository.setSystemStore(VDBMetadataFactory.getSystem());
      return new MetadataFactory(schema, vdbRepository.getBuiltinDatatypes(), importProperties);
  }
View Full Code Here

Examples of org.teiid.metadata.MetadataFactory

      server.deployVDB("vdb", UnitTestUtil.getTestDataPath() + "/TestCase3473/test.vdb");
      Connection conn = server.createConnection("jdbc:teiid:vdb"); //$NON-NLS-1$
     
      Properties importProperties = new Properties();
      importProperties.setProperty("importer.importProcedures", Boolean.TRUE.toString());
      MetadataFactory mf = getMetadata(importProperties, conn);
      Procedure p = mf.getMetadataStore().getSchemas().get("TEST").getProcedures().get("VDB.SYS.GETXMLSCHEMAS");
      assertEquals(1, p.getResultSet().getColumns().size());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.