}
}
public static FakeMetadataFacade example1() {
// Create models
FakeMetadataObject pm1 = FakeMetadataFactory.createPhysicalModel("pm1"); //$NON-NLS-1$
FakeMetadataObject vm1 = FakeMetadataFactory.createVirtualModel("vm1"); //$NON-NLS-1$
// Create physical groups
FakeMetadataObject pm1g1 =
FakeMetadataFactory.createPhysicalGroup("pm1.g1", pm1); //$NON-NLS-1$
FakeMetadataObject pm1g2 =
FakeMetadataFactory.createPhysicalGroup("pm1.g2", pm1); //$NON-NLS-1$
FakeMetadataObject pm1g3 =
FakeMetadataFactory.createPhysicalGroup("pm1.g3", pm1); //$NON-NLS-1$
FakeMetadataObject pm1g4 =
FakeMetadataFactory.createPhysicalGroup("pm1.g4", pm1); //$NON-NLS-1$
FakeMetadataObject pm1g5 =
FakeMetadataFactory.createPhysicalGroup("pm1.g5", pm1); //$NON-NLS-1$
// Create physical elements
List pm1g1e =
FakeMetadataFactory.createElements(
pm1g1,
new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
new String[] {
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.INTEGER,
DataTypeManager.DefaultDataTypes.BOOLEAN,
DataTypeManager.DefaultDataTypes.DOUBLE });
List pm1g2e =
FakeMetadataFactory.createElements(
pm1g2,
new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
new String[] {
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.INTEGER,
DataTypeManager.DefaultDataTypes.BOOLEAN,
DataTypeManager.DefaultDataTypes.DOUBLE });
List pm1g3e =
FakeMetadataFactory.createElements(
pm1g3,
new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
new String[] {
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.INTEGER,
DataTypeManager.DefaultDataTypes.BOOLEAN,
DataTypeManager.DefaultDataTypes.DOUBLE });
List pm1g4e =
FakeMetadataFactory.createElements(
pm1g4,
new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
new String[] {
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.INTEGER,
DataTypeManager.DefaultDataTypes.BOOLEAN,
DataTypeManager.DefaultDataTypes.DOUBLE });
List pm1g5e =
FakeMetadataFactory.createElements(
pm1g5,
new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
new String[] {
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.INTEGER,
DataTypeManager.DefaultDataTypes.BOOLEAN,
DataTypeManager.DefaultDataTypes.DOUBLE });
// Create virtual groups
QueryNode vm1g1n1 = new QueryNode("SELECT * FROM tm1.g1"); //$NON-NLS-1$ //$NON-NLS-2$
//selects from temp group
FakeMetadataObject vm1g1 =
FakeMetadataFactory.createVirtualGroup("vm1.g1", vm1, vm1g1n1); //$NON-NLS-1$
QueryNode vm1g2n1 =
new QueryNode("SELECT * FROM pm1.g2 where pm1.g2.e1=?"); //$NON-NLS-1$ //$NON-NLS-2$
vm1g2n1.addBinding("vm1.g1.e1"); //$NON-NLS-1$
FakeMetadataObject vm1g2 =
FakeMetadataFactory.createVirtualGroup("vm1.g2", vm1, vm1g2n1); //$NON-NLS-1$
QueryNode vm1g3n1 =
new QueryNode("SELECT * FROM pm1.g3 where pm1.g3.e1=?"); //$NON-NLS-1$ //$NON-NLS-2$
vm1g3n1.addBinding("vm1.g2.e1"); //$NON-NLS-1$
FakeMetadataObject vm1g3 =
FakeMetadataFactory.createVirtualGroup("vm1.g3", vm1, vm1g3n1); //$NON-NLS-1$
QueryNode vm1g4n1 = new QueryNode("SELECT * FROM pm1.g4"); //$NON-NLS-1$ //$NON-NLS-2$
FakeMetadataObject vm1g4 =
FakeMetadataFactory.createVirtualGroup("vm1.g4", vm1, vm1g4n1); //$NON-NLS-1$
QueryNode vm1g5n1 =
new QueryNode(
"SELECT * FROM pm1.g5 where pm1.g5.e1=? AND pm1.g5.e2=?"); //$NON-NLS-1$
vm1g5n1.addBinding("vm1.g4.e1"); //$NON-NLS-1$
vm1g5n1.addBinding("vm1.g1.e1"); //$NON-NLS-1$
FakeMetadataObject vm1g5 =
FakeMetadataFactory.createVirtualGroup("vm1.g5", vm1, vm1g5n1); //$NON-NLS-1$
QueryNode tempGroup1 =
new QueryNode("SELECT * FROM pm1.g1 where e2 < '5'"); //$NON-NLS-1$ //$NON-NLS-2$
FakeMetadataObject tm1g1 =
FakeMetadataFactory.createVirtualGroup("tm1.g1", vm1, tempGroup1); //$NON-NLS-1$
// Create virtual elements
List vm1g1e =
FakeMetadataFactory.createElements(
vm1g1,
new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
new String[] {
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.INTEGER,
DataTypeManager.DefaultDataTypes.BOOLEAN,
DataTypeManager.DefaultDataTypes.DOUBLE });
List vm1g2e =
FakeMetadataFactory.createElements(
vm1g2,
new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
new String[] {
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.INTEGER,
DataTypeManager.DefaultDataTypes.BOOLEAN,
DataTypeManager.DefaultDataTypes.DOUBLE });
List vm1g3e =
FakeMetadataFactory.createElements(
vm1g3,
new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
new String[] {
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.INTEGER,
DataTypeManager.DefaultDataTypes.BOOLEAN,
DataTypeManager.DefaultDataTypes.DOUBLE });
List vm1g4e =
FakeMetadataFactory.createElements(
vm1g4,
new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
new String[] {
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.INTEGER,
DataTypeManager.DefaultDataTypes.BOOLEAN,
DataTypeManager.DefaultDataTypes.DOUBLE });
List vm1g5e =
FakeMetadataFactory.createElements(
vm1g5,
new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
new String[] {
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.INTEGER,
DataTypeManager.DefaultDataTypes.BOOLEAN,
DataTypeManager.DefaultDataTypes.DOUBLE });
List tm1g1e =
FakeMetadataFactory.createElements(
tm1g1,
new String[] { "e1", "e2", "e3", "e4" }, //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
new String[] {
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.INTEGER,
DataTypeManager.DefaultDataTypes.BOOLEAN,
DataTypeManager.DefaultDataTypes.DOUBLE });
// Create virtual documents
// DOC 1
FakeMetadataObject doc1 =
FakeMetadataFactory.createVirtualGroup("vm1.doc1", vm1, doc1()); //$NON-NLS-1$
List docE1 =
FakeMetadataFactory.createElements(
doc1,
new String[] {
"a0", //$NON-NLS-1$
"a0.a1", //$NON-NLS-1$
"a0.a1.a1", //$NON-NLS-1$
"a0.a1.b1", //$NON-NLS-1$
"a0.a1.c1" }, //$NON-NLS-1$
new String[] {
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING });
// DOC 2
FakeMetadataObject doc2 =
FakeMetadataFactory.createVirtualGroup("vm1.doc2", vm1, doc2()); //$NON-NLS-1$
List docE2 =
FakeMetadataFactory.createElements(
doc2,
new String[] { "a1" }, //$NON-NLS-1$
new String[] { DataTypeManager.DefaultDataTypes.STRING });
// DOC 3
FakeMetadataObject doc3 =
FakeMetadataFactory.createVirtualGroup("vm1.doc3", vm1, doc3()); //$NON-NLS-1$
List docE3 =
FakeMetadataFactory.createElements(
doc3,
new String[] {
"root", //$NON-NLS-1$
"root.n1", //$NON-NLS-1$
"root.n1.m1", //$NON-NLS-1$
"root.n1.m1.n2", //$NON-NLS-1$
"root.n1.m1.n2.leaf1" }, //$NON-NLS-1$
new String[] {
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING });
// DOC 4
FakeMetadataObject doc4 =
FakeMetadataFactory.createVirtualGroup("vm1.doc4", vm1, doc4()); //$NON-NLS-1$
List docE4 =
FakeMetadataFactory.createElements(
doc4,
new String[] {
"root", //$NON-NLS-1$
"root.n4a", //$NON-NLS-1$
"root.n4a.n4b", //$NON-NLS-1$
"root.n4a.n4c", //$NON-NLS-1$
"root.n4a.fake", //$NON-NLS-1$
"root.n4a.n4c.n4d", //$NON-NLS-1$
"root.n4a.n4c.n4e", //$NON-NLS-1$
"root.n4a.n4c.n4e.n4f" }, //$NON-NLS-1$
new String[] {
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING });
// DOC 5
FakeMetadataObject doc5 =
FakeMetadataFactory.createVirtualGroup("vm1.doc5", vm1, doc5()); //$NON-NLS-1$
List docE5 =
FakeMetadataFactory.createElements(
doc5,
new String[] {
"root", //$NON-NLS-1$
"root.nodea", //$NON-NLS-1$
"root.nodea.nodeb", //$NON-NLS-1$
"root.nodea.nodec", //$NON-NLS-1$
"root.nodea.nodec.noded", //$NON-NLS-1$
"root.nodea.nodec.nodee", //$NON-NLS-1$
"root.nodea.nodec.nodee.nodef", //$NON-NLS-1$
"root.nodea.nodec.nodee.nodeg", //$NON-NLS-1$
"root.nodea.nodec.nodee.nodeg.nodeh", //$NON-NLS-1$
"root.nodea.nodec.nodee.nodeg.nodeI", //$NON-NLS-1$
"root.nodea.nodec.nodee.nodeg.nodeI.nodeJ" }, //$NON-NLS-1$
new String[] {
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING });
// DOC 6
FakeMetadataObject doc6 =
FakeMetadataFactory.createVirtualGroup("vm1.doc6", vm1, doc6()); //$NON-NLS-1$
List docE6 =
FakeMetadataFactory.createElements(
doc6,
new String[] { "tempGroupTest" }, //$NON-NLS-1$
new String[] { DataTypeManager.DefaultDataTypes.STRING });
// DOC with excluded fragment
FakeMetadataObject docWithExcluded =
FakeMetadataFactory.createVirtualGroup(
"vm1.docWithExcluded", //$NON-NLS-1$
vm1,
docWithExcluded());
List docWithExcludedElements =
FakeMetadataFactory.createElements(
docWithExcluded,
new String[] {
"root", //$NON-NLS-1$
"root.n1", //$NON-NLS-1$
"root.n1.m1", //$NON-NLS-1$
"root.n1.m1.n2", //$NON-NLS-1$
"root.n1.m1.n2.leaf1" }, //$NON-NLS-1$
new String[] {
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING });
// DOC 2 with excluded fragment
FakeMetadataObject doc2WithExcluded =
FakeMetadataFactory.createVirtualGroup(
"vm1.docWithExcluded2", //$NON-NLS-1$
vm1,
docWithExcluded2());
List doc2WithExcludedElements =
FakeMetadataFactory.createElements(
doc2WithExcluded,
new String[] {
"root", //$NON-NLS-1$
"root.n1", //$NON-NLS-1$
"root.n1.m1", //$NON-NLS-1$
"root.n1.m2", //$NON-NLS-1$
"root.n1.m3" }, //$NON-NLS-1$
new String[] {
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING });
// DOC with attribute
FakeMetadataObject docWithAttribute =
FakeMetadataFactory.createVirtualGroup(
"vm1.docWithAttribute", //$NON-NLS-1$
vm1,
docTestConvertCriteriaWithAttribute());
FakeMetadataObject docWithAttribute3 =
FakeMetadataFactory.createVirtualGroup(
"vm1.docWithAttribute3", //$NON-NLS-1$
vm1,
docTestCriteriaWithAttribute());
List docWithAttributeElements =
FakeMetadataFactory.createElements(
docWithAttribute,
new String[] {
"root", //$NON-NLS-1$
"root.myElement", //$NON-NLS-1$
"root.@myAttribute"}, //$NON-NLS-1$
new String[] {
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING,
DataTypeManager.DefaultDataTypes.STRING });
// DOC with attribute2
FakeMetadataObject docWithAttribute2 =
FakeMetadataFactory.createVirtualGroup(
"vm1.docWithAttribute2", //$NON-NLS-1$
vm1,
docTestConvertCriteriaWithAttribute2());
List docWithAttributeElements2 =