Examples of ModelMetadata


Examples of org.teiid.adminapi.impl.ModelMetaData

  private boolean isFileVisible(String pathInVDB, VDBMetaData vdb) {

    if (pathInVDB.endsWith(".xmi")) { //$NON-NLS-1$
      String modelName = StringUtil.getFirstToken(StringUtil.getLastToken(pathInVDB, "/"), "."); //$NON-NLS-1$ //$NON-NLS-2$
 
      ModelMetaData model = vdb.getModel(modelName);
      if (model != null) {
        return model.isVisible();
      }
    }
   
    if (pathInVDB.startsWith("META-INF/")) {//$NON-NLS-1$
      return false;
View Full Code Here

Examples of org.teiid.adminapi.impl.ModelMetaData

  public void removeVDB(String vdbName) {
    this.repo.removeVDB(vdbName, 1);
  }

  private void addModel(VDBMetaData vdbMetaData, Schema schema) {
    ModelMetaData model = new ModelMetaData();
    model.setName(schema.getName());
    vdbMetaData.addModel(model);
    model.addSourceMapping("source", "translator", "jndi:source");
  }
View Full Code Here

Examples of org.teiid.adminapi.impl.ModelMetaData

   
    public static VDBMetaData examplePrivatePhysicalModelVDB() {
      VDBMetaData vdb = new VDBMetaData();
      vdb.setName("example1");
      vdb.setVersion(1);
      ModelMetaData m = createModel("pm1", true);
      m.setVisible(false);
      vdb.addModel(m);
      vdb.addModel(createModel("vm1", false));
     
      return vdb;
    }   
View Full Code Here

Examples of org.teiid.adminapi.impl.ModelMetaData

    public static VDBMetaData exampleMultiBindingVDB() {
      VDBMetaData vdb = new VDBMetaData();
      vdb.setName("exampleMultiBinding");
      vdb.setVersion(1);
     
      ModelMetaData model = new ModelMetaData();
      model.setName("MultiModel");
       model.setModelType(Model.Type.PHYSICAL);
      model.setVisible(true);
     
      model.setSupportsMultiSourceBindings(true);
      vdb.addModel(model);
      vdb.addModel(createModel("Virt", false));
     
      return vdb;
    }
View Full Code Here

Examples of org.teiid.adminapi.impl.ModelMetaData

          aqr.setTransactionContext(workItem.getTransactionContext());
        }
        aqr.setFetchSize(this.bufferService.getBufferManager().getConnectorBatchSize());
        if (connectorBindingId == null) {
          VDBMetaData vdb = workItem.getDqpWorkContext().getVDB();
          ModelMetaData model = vdb.getModel(modelName);
          List<String> bindings = model.getSourceNames();
          if (bindings == null || bindings.size() != 1) {
              // this should not happen, but it did occur when setting up the SystemAdmin models
              throw new TeiidComponentException(QueryPlugin.Util.getString("DataTierManager.could_not_obtain_connector_binding", new Object[]{modelName, workItem.getDqpWorkContext().getVdbName(), workItem.getDqpWorkContext().getVdbVersion() })); //$NON-NLS-1$
          }
          connectorBindingId = bindings.get(0);
View Full Code Here

Examples of org.teiid.adminapi.impl.ModelMetaData

      SourceCapabilities caps = userCache.get(modelName);
        if(caps != null) {
            return caps;
        }
        TranslatorException exception = null;
        ModelMetaData model = vdb.getModel(modelName);
        for (String sourceName:model.getSourceNames()) {
          try {
            ConnectorManager mgr = this.connectorRepo.getConnectorManager(sourceName);
            if (mgr == null) {
              throw new TranslatorException(QueryPlugin.Util.getString("CachedFinder.no_connector_found", sourceName, modelName, sourceName)); //$NON-NLS-1$
            }
View Full Code Here

Examples of org.teiid.adminapi.impl.ModelMetaData

     
      return vdb;
    }
   
    public static ModelMetaData createModel(String name, boolean source) {
      ModelMetaData model = new ModelMetaData();
      model.setName(name);
      if (source) {
        model.setModelType(Model.Type.PHYSICAL);
      }
      else {
        model.setModelType(Model.Type.VIRTUAL);
      }
      model.setVisible(true);
      model.setSupportsMultiSourceBindings(false);
      model.addSourceMapping(name, name, null);
     
      return model;
    }
View Full Code Here

Examples of play.utils.meta.ModelMetadata

        ClasspathHelper.forPackage("", classloaders)).setScanners(new SubTypesScanner(),
        new TypeAnnotationsScanner()).addClassLoaders(classloaders));

    Set<Class<?>> entities = reflections.getTypesAnnotatedWith(Entity.class);
    for (Class<?> entity : entities) {
      ModelMetadata metadata = getMetadata(entity);
      map.put(entity, metadata);
    }

    return map;
  }
View Full Code Here

Examples of play.utils.meta.ModelMetadata

      }
    });
    if (log.isDebugEnabled())
      log.debug("keyField : " + keyField);
   
    ModelMetadata metadata = null;
    if (keyField.isPresent()) {
      metadata = new ModelMetadata(entity, fields, keyField.get());
    }
    return metadata;
  }
View Full Code Here

Examples of play.utils.meta.ModelMetadata

        }

        if (controller != null) {
          Class modelClass = controller.getModelClass();
          log.info("Found controller:" + controllerClass + " (" + modelClass + ")");
          ModelMetadata model = models.getModel(modelClass);
          if (model != null) {
            map.put(modelClass, new ControllerProxyREST(controller, model));
          }
        }
      } catch (Exception e) {
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.