本文整理汇总了Java中org.teiid.adminapi.impl.VDBMetaData.setName方法的典型用法代码示例。如果您正苦于以下问题:Java VDBMetaData.setName方法的具体用法?Java VDBMetaData.setName怎么用?Java VDBMetaData.setName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.teiid.adminapi.impl.VDBMetaData
的用法示例。
在下文中一共展示了VDBMetaData.setName方法的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: 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());
}
示例9: 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;
}
示例10: testMatViewWithImportedVDB
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test public void testMatViewWithImportedVDB() throws Exception {
ModelMetaData mmd = new ModelMetaData();
mmd.setName("phy");
mmd.setSchemaSourceType("DDL");
mmd.setSchemaText("CREATE FOREIGN TABLE t1 ( col1 string, col2 integer )");
mmd.addSourceMapping("phy", "loopback", null);
ModelMetaData mmd1 = new ModelMetaData();
mmd1.setName("phy_mv");
mmd1.setSchemaSourceType("DDL");
mmd1.setSchemaText("CREATE FOREIGN TABLE t1_mv ( col1 string, col2 integer )");
mmd1.addSourceMapping("phy_mv", "loopback", null);
ModelMetaData mmd2 = new ModelMetaData();
mmd2.setName("view1");
mmd2.setModelType(Type.VIRTUAL);
mmd2.setSchemaSourceType("DDL");
mmd2.setSchemaText("CREATE VIEW v1 ( col1 string, col2 integer ) OPTIONS (MATERIALIZED true, MATERIALIZED_TABLE 'phy_mv.t1_mv') AS select t1.col1, t1.col2 FROM t1");
server.addTranslator(LoopbackExecutionFactory.class);
server.deployVDB("base", mmd, mmd1, mmd2);
VDBMetaData vdbMetaData = new VDBMetaData();
vdbMetaData.setXmlDeployment(true);
VDBImportMetadata importVDB = new VDBImportMetadata();
importVDB.setName("base");
importVDB.setVersion(1);
vdbMetaData.getVDBImports().add(importVDB);
vdbMetaData.setName("importing");
server.deployVDB(vdbMetaData);
}
示例11: testImportedMatView
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test public void testImportedMatView() throws Exception {
ModelMetaData mmd2 = new ModelMetaData();
mmd2.setName("view1");
mmd2.setModelType(Type.PHYSICAL);
mmd2.setSchemaSourceType("DDL");
mmd2.setSchemaText("create foreign table x (col integer); CREATE VIEW v1 ( col1 string ) OPTIONS (MATERIALIZED true) AS select current_database() from x");
mmd2.addSourceMapping("a", "a", null);
HardCodedExecutionFactory hcef = new HardCodedExecutionFactory();
hcef.addData("SELECT x.col FROM x", Arrays.asList(Collections.singletonList(1)));
server.addTranslator("a", hcef);
server.deployVDB("base", mmd2);
VDBMetaData vdbMetaData = new VDBMetaData();
vdbMetaData.setXmlDeployment(true);
VDBImportMetadata importVDB = new VDBImportMetadata();
importVDB.setName("base");
importVDB.setVersion(1);
vdbMetaData.getVDBImports().add(importVDB);
vdbMetaData.setName("importing");
server.deployVDB(vdbMetaData);
Connection c = server.getDriver().connect("jdbc:teiid:importing", null);
Statement s = c.createStatement();
ResultSet rs = s.executeQuery("select * from v1");
rs.next();
assertEquals("base", rs.getString(1));
}
示例12: testOptionalFK
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test
public void testOptionalFK() throws Exception {
String ddl = "CREATE FOREIGN TABLE G1(g1e1 integer, g1e2 varchar, PRIMARY KEY(g1e1, g1e2));\n" +
"CREATE FOREIGN TABLE G2( g2e1 integer, g2e2 varchar, PRIMARY KEY(g2e1, g2e2)," +
"FOREIGN KEY (g2e1, g2e2) REFERENCES G1)";
MetadataFactory s = helpParse(ddl, "model");
Map<String, Table> tableMap = s.getSchema().getTables();
assertEquals(2, tableMap.size());
assertTrue("Table not found", tableMap.containsKey("G1"));
assertTrue("Table not found", tableMap.containsKey("G2"));
Table table = tableMap.get("G2");
ForeignKey fk = table.getForeignKeys().get(0);
assertEquals(fk.getColumns(), table.getColumns());
assertEquals("G1", fk.getReferenceTableName());
VDBMetaData vdb = new VDBMetaData();
vdb.setName("myVDB"); //$NON-NLS-1$
ModelMetaData modelOne = new ModelMetaData();
modelOne.setName("model"); //$NON-NLS-1$
vdb.addModel(modelOne);
ValidatorReport report = new MetadataValidator().validate(vdb, s.asMetadataStore());
assertFalse(report.hasItems());
assertEquals(fk.getPrimaryKey().getColumns(), tableMap.get("G1").getColumns());
}
示例13: testOptionalFKFail
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test
public void testOptionalFKFail() throws Exception {
String ddl = "CREATE FOREIGN TABLE G1(g1e1 integer, g1e2 varchar);\n" +
"CREATE FOREIGN TABLE G2( g2e1 integer, g2e2 varchar, PRIMARY KEY(g2e1, g2e2)," +
"FOREIGN KEY (g2e1, g2e2) REFERENCES G1)";
MetadataFactory s = helpParse(ddl, "model");
Map<String, Table> tableMap = s.getSchema().getTables();
assertEquals(2, tableMap.size());
assertTrue("Table not found", tableMap.containsKey("G1"));
assertTrue("Table not found", tableMap.containsKey("G2"));
Table table = tableMap.get("G2");
ForeignKey fk = table.getForeignKeys().get(0);
assertEquals(fk.getColumns(), table.getColumns());
assertEquals("G1", fk.getReferenceTableName());
VDBMetaData vdb = new VDBMetaData();
vdb.setName("myVDB"); //$NON-NLS-1$
ModelMetaData modelOne = new ModelMetaData();
modelOne.setName("model"); //$NON-NLS-1$
vdb.addModel(modelOne);
ValidatorReport report = new MetadataValidator().validate(vdb, s.asMetadataStore());
assertTrue(report.hasItems());
}
示例14: testFKAccrossSchemas
import org.teiid.adminapi.impl.VDBMetaData; //导入方法依赖的package包/类
@Test
public void testFKAccrossSchemas() throws Exception {
String ddl = "CREATE FOREIGN TABLE G1(g1e1 integer, g1e2 varchar, PRIMARY KEY(g1e1, g1e2));\n";
String ddl2 = "CREATE FOREIGN TABLE G2( g2e1 integer, g2e2 varchar, PRIMARY KEY(g2e1, g2e2)," +
"FOREIGN KEY (g2e1, g2e2) REFERENCES model.G1)";
MetadataFactory f1 = helpParse(ddl, "model");
MetadataFactory f2 = helpParse(ddl2, "model2");
VDBMetaData vdb = new VDBMetaData();
vdb.setName("myVDB"); //$NON-NLS-1$
ModelMetaData modelOne = new ModelMetaData();
modelOne.setName("model"); //$NON-NLS-1$
vdb.addModel(modelOne);
ModelMetaData modelTwo = new ModelMetaData();
modelTwo.setName("model2"); //$NON-NLS-1$
vdb.addModel(modelTwo);
MetadataStore s = f1.asMetadataStore();
f2.mergeInto(s);
ValidatorReport report = new MetadataValidator().validate(vdb, s);
assertFalse(report.hasItems());
Table table = s.getSchema("model2").getTable("G2");
ForeignKey fk = table.getForeignKeys().get(0);
assertEquals(fk.getColumns(), table.getColumns());
assertEquals("G1", fk.getReferenceTableName());
assertEquals(fk.getPrimaryKey().getColumns(), s.getSchema("model").getTable("G1").getColumns());
}
示例15: 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);
}