本文整理汇总了Java中org.teiid.adminapi.impl.VDBMetaData.setVersion方法的典型用法代码示例。如果您正苦于以下问题:Java VDBMetaData.setVersion方法的具体用法?Java VDBMetaData.setVersion怎么用?Java VDBMetaData.setVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.teiid.adminapi.impl.VDBMetaData
的用法示例。
在下文中一共展示了VDBMetaData.setVersion方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTransformationMetadata
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
public static TransformationMetadata createTransformationMetadata(CompositeMetadataStore store, String vdbName, Properties vdbProperties, FunctionTree... functionModels) {
VDBMetaData vdbMetaData = new VDBMetaData();
vdbMetaData.setName(vdbName); //$NON-NLS-1$
vdbMetaData.setVersion(1);
if (vdbProperties != null) {
vdbMetaData.setProperties(vdbProperties);
}
List<FunctionTree> udfs = new ArrayList<FunctionTree>();
udfs.addAll(Arrays.asList(functionModels));
for (Schema schema : store.getSchemas().values()) {
vdbMetaData.addModel(RealMetadataFactory.createModel(schema.getName(), schema.isPhysical()));
if (!schema.getFunctions().isEmpty()) {
udfs.add(new FunctionTree(schema.getName(), new UDFSource(schema.getFunctions().values()), true));
}
}
TransformationMetadata metadata = new TransformationMetadata(vdbMetaData, store, null, SFM.getSystemFunctions(), udfs);
vdbMetaData.addAttchment(TransformationMetadata.class, metadata);
vdbMetaData.addAttchment(QueryMetadataInterface.class, metadata);
return metadata;
}
示例2: example1VDB
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
public static VDBMetaData example1VDB() {
VDBMetaData vdb = new VDBMetaData();
vdb.setName("example1");
vdb.setVersion(1);
vdb.addModel(RealMetadataFactory.createModel("pm1", true));
vdb.addModel(RealMetadataFactory.createModel("pm2", true));
vdb.addModel(RealMetadataFactory.createModel("pm3", true));
vdb.addModel(RealMetadataFactory.createModel("pm4", true));
vdb.addModel(RealMetadataFactory.createModel("pm5", true));
vdb.addModel(RealMetadataFactory.createModel("pm6", true));
vdb.addModel(RealMetadataFactory.createModel("vm1", false));
vdb.addModel(RealMetadataFactory.createModel("vm2", false));
vdb.addModel(RealMetadataFactory.createModel("tm1", false));
return vdb;
}
示例3: exampleBQTVDB
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
public static VDBMetaData exampleBQTVDB() {
VDBMetaData vdb = new VDBMetaData();
vdb.setName("example1");
vdb.setVersion(1);
vdb.addModel(RealMetadataFactory.createModel("BQT1", true));
vdb.addModel(RealMetadataFactory.createModel("BQT2", true));
vdb.addModel(RealMetadataFactory.createModel("BQT3", true));
vdb.addModel(RealMetadataFactory.createModel("LOB", true));
vdb.addModel(RealMetadataFactory.createModel("VQT", false));
vdb.addModel(RealMetadataFactory.createModel("pm1", true));
vdb.addModel(RealMetadataFactory.createModel("pm2", true));
vdb.addModel(RealMetadataFactory.createModel("pm3", true));
vdb.addModel(RealMetadataFactory.createModel("pm4", true));
return vdb;
}
示例4: exampleMultiBindingVDB
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
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(RealMetadataFactory.createModel("Virt", false));
return vdb;
}
示例5: testActiveVDBWithNoVersion
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test
public void testActiveVDBWithNoVersion() throws Exception {
VDBRepository repo = Mockito.mock(VDBRepository.class);
VDBMetaData vdb = new VDBMetaData();
vdb.setName("name");
vdb.setVersion(1);
vdb.setStatus(Status.ACTIVE);
Mockito.stub(repo.getLiveVDB("name")).toReturn(vdb);
ssi.setVDBRepository(repo);
ssi.getActiveVDB("name", null);
Mockito.verify(repo, Mockito.times(1)).getLiveVDB("name");
}
示例6: testActiveVDBWithVersion
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test
public void testActiveVDBWithVersion() throws Exception {
VDBRepository repo = Mockito.mock(VDBRepository.class);
VDBMetaData vdb = new VDBMetaData();
vdb.setName("name");
vdb.setVersion(1);
vdb.setStatus(Status.ACTIVE);
Mockito.stub(repo.getLiveVDB("name", 1)).toReturn(vdb);
ssi.setVDBRepository(repo);
ssi.getActiveVDB("name", "1");
Mockito.verify(repo, Mockito.times(1)).getLiveVDB("name", 1);
}
示例7: testActiveVDBNameWithVersion
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test
public void testActiveVDBNameWithVersion() throws Exception {
VDBRepository repo = Mockito.mock(VDBRepository.class);
VDBMetaData vdb = new VDBMetaData();
vdb.setName("name");
vdb.setVersion(1);
vdb.setStatus(Status.ACTIVE);
Mockito.stub(repo.getLiveVDB("name", 1)).toReturn(vdb);
ssi.setVDBRepository(repo);
ssi.getActiveVDB("name.1", null);
Mockito.verify(repo, Mockito.times(1)).getLiveVDB("name", 1);
}
示例8: testActiveVDBNameWithVersionNonInteger
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test
public void testActiveVDBNameWithVersionNonInteger() throws Exception {
VDBRepository repo = Mockito.mock(VDBRepository.class);
VDBMetaData vdb = new VDBMetaData();
vdb.setName("name");
vdb.setVersion(1);
vdb.setStatus(Status.ACTIVE);
Mockito.stub(repo.getLiveVDB("name", 1)).toReturn(vdb);
ssi.setVDBRepository(repo);
try {
ssi.getActiveVDB("name.x", null);
fail("must have failed with non integer version");
} catch (SessionServiceException e) {
}
}
示例9: testSecurityDomain
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test public void testSecurityDomain() throws Exception {
VDBRepository repo = Mockito.mock(VDBRepository.class);
VDBMetaData vdb = new VDBMetaData();
vdb.setName("name");
vdb.setVersion(1);
vdb.setStatus(Status.ACTIVE);
vdb.addProperty(SessionServiceImpl.SECURITY_DOMAIN_PROPERTY, "domain");
Mockito.stub(repo.getLiveVDB("name", 1)).toReturn(vdb);
ssi.setVDBRepository(repo);
Properties properties = new Properties();
properties.setProperty(TeiidURL.JDBC.VDB_NAME, "name.1");
SessionMetadata s = ssi.createSession("name", "1", AuthenticationType.USERPASSWORD, "x", new Credentials(new char[] {'y'}), "z", properties);
assertEquals("domain", s.getSecurityDomain());
}
示例10: createVdb
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
/**
* Create a VDB object
* @param vdbName the name of the VDB
* @param vdbVersion the vdb version
* @return the VDBMetadata
*/
public VDBMetaData createVdb(String vdbName, int vdbVersion, Properties vdbProperties) {
VDBMetaData vdb = new VDBMetaData();
vdb.setName(vdbName);
vdb.setDescription("VDB for: "+vdbName+", Version: "+vdbVersion);
vdb.setVersion(vdbVersion);
vdb.setProperties(vdbProperties);
return vdb;
}
示例11: exampleTransformationMetadata
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
private TransformationMetadata exampleTransformationMetadata()
throws TranslatorException {
Map<String, Datatype> datatypes = new HashMap<String, Datatype>();
Datatype dt = new Datatype();
dt.setName(DataTypeManager.DefaultDataTypes.STRING);
dt.setJavaClassName(String.class.getCanonicalName());
datatypes.put(DataTypeManager.DefaultDataTypes.STRING, dt);
MetadataFactory mf = new MetadataFactory(null, 1, "x", datatypes, new Properties(), null); //$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(null, 1, "x1", datatypes, new Properties(), null); //$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, VDBResources.Resource> resources = new HashMap<String, VDBResources.Resource>();
resources.put("/x.xsd", new VDBResources.Resource(VFS.getRootVirtualFile()));
CompositeMetadataStore cms = new CompositeMetadataStore(Arrays.asList(mf.asMetadataStore(), mf1.asMetadataStore()));
VDBMetaData vdb = new VDBMetaData();
vdb.setName("vdb");
vdb.setVersion(1);
vdb.addModel(buildModel("x"));
vdb.addModel(buildModel("x1"));
vdb.addModel(buildModel("y"));
return new TransformationMetadata(vdb, cms, resources, RealMetadataFactory.SFM.getSystemFunctions(), null);
}
示例12: testAmbiguousTableWithPrivateModel
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test public void testAmbiguousTableWithPrivateModel() throws Exception {
Map<String, Datatype> datatypes = new HashMap<String, Datatype>();
Datatype dt = new Datatype();
dt.setName(DataTypeManager.DefaultDataTypes.STRING);
dt.setJavaClassName(String.class.getCanonicalName());
datatypes.put(DataTypeManager.DefaultDataTypes.STRING, dt);
MetadataFactory mf = new MetadataFactory(null, 1, "x", datatypes, new Properties(), null); //$NON-NLS-1$
mf.addTable("y"); //$NON-NLS-1$
MetadataFactory mf1 = new MetadataFactory(null, 1, "x1", datatypes, new Properties(), null); //$NON-NLS-1$
mf1.addTable("y"); //$NON-NLS-1$
CompositeMetadataStore cms = new CompositeMetadataStore(Arrays.asList(mf.asMetadataStore(), mf1.asMetadataStore()));
VDBMetaData vdb = new VDBMetaData();
vdb.setName("foo");
vdb.setVersion(1);
ModelMetaData model = new ModelMetaData();
model.setName("x1");
vdb.addModel(model);
ModelMetaData model2 = new ModelMetaData();
model2.setName("x");
model2.setVisible(true);
vdb.addModel(model2);
TransformationMetadata tm = new TransformationMetadata(vdb, cms, null, RealMetadataFactory.SFM.getSystemFunctions(), null);
Collection result = tm.getGroupsForPartialName("y"); //$NON-NLS-1$
assertEquals(2, result.size());
RealMetadataFactory.buildWorkContext(tm, vdb);
model.setVisible(false);
tm = new TransformationMetadata(vdb, cms, null, RealMetadataFactory.SFM.getSystemFunctions(), null);
result = tm.getGroupsForPartialName("y"); //$NON-NLS-1$
assertEquals(1, result.size());
}
示例13: examplePrivatePhysicalModelVDB
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
public static VDBMetaData examplePrivatePhysicalModelVDB() {
VDBMetaData vdb = new VDBMetaData();
vdb.setName("example1");
vdb.setVersion(1);
ModelMetaData m = RealMetadataFactory.createModel("pm1", true);
m.setVisible(false);
vdb.addModel(m);
vdb.addModel(RealMetadataFactory.createModel("vm1", false));
return vdb;
}
示例14: setUp
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Before public void setUp() {
MetadataStore metadataStore = new MetadataStore();
CompositeMetadataStore store = new CompositeMetadataStore(metadataStore);
VDBMetaData vdbMetaData = new VDBMetaData();
vdbMetaData.setName("foo"); //$NON-NLS-1$
vdbMetaData.setVersion(1);
Map<String, VDBResources.Resource> vdbEntries = new LinkedHashMap<String, VDBResources.Resource>();
vdbEntries.put(MY_RESOURCE_PATH, new VDBResources.Resource(root.getChild("foo")));
metadataFactory = new RuntimeMetadataImpl(new TransformationMetadata(vdbMetaData, store, vdbEntries, null, null));
}
示例15: addVdb
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
private VDBMetaData addVdb(VDBRepository repo, String name, String sc, String authenticationType) {
VDBMetaData vdb = new VDBMetaData();
vdb.setName(name);
vdb.setVersion(1);
vdb.setStatus(Status.ACTIVE);
Mockito.stub(repo.getLiveVDB(name, 1)).toReturn(vdb);
vdb.addProperty(SessionServiceImpl.SECURITY_DOMAIN_PROPERTY, sc);
vdb.addProperty(SessionServiceImpl.AUTHENTICATION_TYPE_PROPERTY, authenticationType);
return vdb;
}