@Override public boolean isSupportsMultiSourceBindings() { return this.isSource() && (this.sources.size() > 1 || Boolean.parseBoolean(getPropertyValue(SUPPORTS_MULTI_SOURCE_BINDINGS_KEY)) || Boolean.parseBoolean(getPropertyValue(SUPPORTS_MULTI_SOURCE_BINDINGS_KEY_OLD))); }
@Override public boolean isSupportsMultiSourceBindings() { return this.isSource() && (this.sources.size() > 1 || Boolean.parseBoolean(getPropertyValue(SUPPORTS_MULTI_SOURCE_BINDINGS_KEY)) || Boolean.parseBoolean(getPropertyValue(SUPPORTS_MULTI_SOURCE_BINDINGS_KEY_OLD))); }
public static Map<String, String> getMultiSourceModels(VDBMetaData vdb) { HashMap<String, String> result = new HashMap<String, String>(); for (ModelMetaData mmd : vdb.getModelMetaDatas().values()) { if (!mmd.isSupportsMultiSourceBindings()) { continue; } String columnName = mmd.getPropertyValue(MULTISOURCE_COLUMN_NAME); if (columnName == null) { columnName = MultiSourceElement.DEFAULT_MULTI_SOURCE_ELEMENT_NAME; } result.put(mmd.getName(), columnName); } return result; }
public static Map<String, String> getMultiSourceModels(VDBMetaData vdb) { HashMap<String, String> result = new HashMap<String, String>(); for (ModelMetaData mmd : vdb.getModelMetaDatas().values()) { if (!mmd.isSupportsMultiSourceBindings()) { continue; } String columnName = mmd.getPropertyValue(MULTISOURCE_COLUMN_NAME); if (columnName == null) { columnName = MultiSourceElement.DEFAULT_MULTI_SOURCE_ELEMENT_NAME; } result.put(mmd.getName(), columnName); } return result; }
public static Map<String, String> getMultiSourceModels(VDBMetaData vdb) { HashMap<String, String> result = new HashMap<String, String>(); for (ModelMetaData mmd : vdb.getModelMetaDatas().values()) { if (!mmd.isSupportsMultiSourceBindings()) { continue; } String columnName = mmd.getPropertyValue(MULTISOURCE_COLUMN_NAME); if (columnName == null) { columnName = MultiSourceElement.DEFAULT_MULTI_SOURCE_ELEMENT_NAME; } result.put(mmd.getName(), columnName); } return result; }
protected void assignMetadataRepositories(VDBMetaData deployment, MetadataRepository<?, ?> defaultRepo) throws VirtualDatabaseException { for (ModelMetaData model:deployment.getModelMetaDatas().values()) { if (model.getModelType() != Type.OTHER && (model.getName() == null || model.getName().indexOf('.') >= 0) || model.getName().equalsIgnoreCase(CoreConstants.SYSTEM_MODEL) || model.getName().equalsIgnoreCase(CoreConstants.SYSTEM_ADMIN_MODEL) || model.getName().equalsIgnoreCase(CoreConstants.ODBC_MODEL)) { throw new VirtualDatabaseException(RuntimePlugin.Event.TEIID40121, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40121, model.getName(), deployment.getName(), deployment.getVersion())); } if (model.isSource() && model.getSourceNames().isEmpty()) { throw new VirtualDatabaseException(RuntimePlugin.Event.TEIID40093, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40093, model.getName(), deployment.getName(), deployment.getVersion())); } if (model.getModelType() == Type.FUNCTION || model.getModelType() == Type.OTHER) { continue; } MetadataRepository<?, ?> repo = getMetadataRepository(deployment, model, defaultRepo); //handle multi-source column creation if (model.isSupportsMultiSourceBindings() && Boolean.valueOf(model.getPropertyValue("multisource.addColumn"))) { //$NON-NLS-1$ List<MetadataRepository<?, ?>> repos = new ArrayList<MetadataRepository<?, ?>>(2); repos.add(repo); String columnName = model.getPropertyValue(MultiSourceMetadataWrapper.MULTISOURCE_COLUMN_NAME); repos.add(new MultiSourceMetadataRepository(columnName==null?MultiSourceElement.DEFAULT_MULTI_SOURCE_ELEMENT_NAME:columnName)); repo = new ChainingMetadataRepository(repos); } model.addAttchment(MetadataRepository.class, repo); } }
String loadScript = t.getProperty(MATVIEW_LOAD_SCRIPT, false); if (status == null) { status = model.getPropertyValue(MATVIEW_STATUS_TABLE); if (status == null) { status = vdb.getPropertyValue(MATVIEW_STATUS_TABLE);
String loadScript = t.getProperty(MATVIEW_LOAD_SCRIPT, false); if (status == null) { status = model.getPropertyValue(MATVIEW_STATUS_TABLE); if (status == null) { status = vdb.getPropertyValue(MATVIEW_STATUS_TABLE);
assertEquals("s1", modelOne.getSourceNames().get(0)); //$NON-NLS-1$ assertEquals(Model.Type.PHYSICAL, modelOne.getModelType()); assertEquals("model-value-override", modelOne.getPropertyValue("model-prop")); //$NON-NLS-1$ //$NON-NLS-2$ assertFalse(modelOne.isVisible()); assertEquals("model description", modelOne.getDescription()); assertTrue(modelTwo.getSourceNames().contains("s2")); //$NON-NLS-1$ assertEquals("model-value", modelTwo.getPropertyValue("model-prop")); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("DDL", modelTwo.getSourceMetadataType().get(0)); assertEquals("DDL Here", modelTwo.getSourceMetadataText().get(0));