Search in sources :

Example 1 with TableAliasColumn

use of org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.TableAliasColumn in project legend-pure by finos.

the class TestSimpleGrammar method testMappingScope.

@Test
public void testMappingScope() {
    Loader.parseM3("import other::*;\n" + "\n" + "Class other::Person\n" + "{\n" + "    name : String[1];\n" + "    id : Integer[1];" + "    other : String[1];" + "}\n" + "###Relational\n" + "Database mapping::pack::db" + "(" + "    Table employeeTable\n" + "    (\n" + "        id INT PRIMARY KEY,\n" + "        name VARCHAR(200),\n" + "        other VARCHAR(200),\n" + "        firmId INT\n" + "    )" + ")\n" + "###Mapping\n" + "import mapping::pack::*;\n" + "Mapping mappingPackage::myMapping\n" + "(\n" + " /* comment */\n" + "    other::Person: Relational\n" + "            {" + "                scope([db])" + "                (" + "                    name : employeeTable.name\n" + "                )," + "                scope([db]default.employeeTable)" + "                (" + "                    id : id" + "                )," + "                scope([db]employeeTable)" + "                (" + "                    other : other" + "                )" + "            }\n" + ")\n", this.repository, new ParserLibrary(Lists.immutable.with(new M3AntlrParser(), new MappingParser(), new RelationalParser())), ValidationType.DEEP, VoidM3M4StateListener.VOID_M3_M4_STATE_LISTENER, this.context);
    this.runtime.compile();
    CoreInstance mapping = this.runtime.getCoreInstance("mappingPackage::myMapping");
    CoreInstance personClassMappingImplementation = Instance.getValueForMetaPropertyToManyResolved(mapping, "classMappings", this.processorSupport).getFirst();
    ListIterable<? extends CoreInstance> personClassMappingImplementationPropertyMappings = Instance.getValueForMetaPropertyToManyResolved(personClassMappingImplementation, "propertyMappings", this.processorSupport);
    final StringBuilder sb = new StringBuilder("[\n");
    personClassMappingImplementationPropertyMappings.forEach(new Procedure<CoreInstance>() {

        @Override
        public void value(CoreInstance each) {
            CoreInstance relationalOperationElement = Instance.getValueForMetaPropertyToOneResolved(each, "relationalOperationElement", TestSimpleGrammar.this.processorSupport);
            Printer.print(sb, relationalOperationElement, 3);
            sb.append("\n");
        }
    });
    final String mappingGraphDump = sb.append("]").toString();
    Assert.assertEquals("[\n" + "Anonymous_StripedId instance TableAliasColumn\n" + "    alias(Property):\n" + "        Anonymous_StripedId instance TableAlias\n" + "            database(Property):\n" + "                [~>] db instance Database\n" + "            name(Property):\n" + "                employeeTable instance String\n" + "            relationalElement(Property):\n" + "                Anonymous_StripedId instance Table\n" + "                    columns(Property):\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            nullable(Property):\n" + "                                [>3] false instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] name instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] other instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] firmId instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                    milestoning(Property):\n" + "                    name(Property):\n" + "                        employeeTable instance String\n" + "                    primaryKey(Property):\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            nullable(Property):\n" + "                                [>3] false instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                    schema(Property):\n" + "                        Anonymous_StripedId instance Schema\n" + "                            database(Property):\n" + "                                [X] db instance Database\n" + "                            name(Property):\n" + "                                [>3] default instance String\n" + "                            relations(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            tables(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            views(Property):\n" + "                    setColumns(Property):\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            nullable(Property):\n" + "                                [>3] false instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] name instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] other instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] firmId instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                    temporaryTable(Property):\n" + "                        false instance Boolean\n" + "    column(Property):\n" + "        Anonymous_StripedId instance Column\n" + "            name(Property):\n" + "                name instance String\n" + "            nullable(Property):\n" + "                true instance Boolean\n" + "            owner(Property):\n" + "                Anonymous_StripedId instance Table\n" + "                    columns(Property):\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            nullable(Property):\n" + "                                [>3] false instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                        [_] Anonymous_StripedId instance Column\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] other instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] firmId instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                    milestoning(Property):\n" + "                    name(Property):\n" + "                        employeeTable instance String\n" + "                    primaryKey(Property):\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            nullable(Property):\n" + "                                [>3] false instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                    schema(Property):\n" + "                        Anonymous_StripedId instance Schema\n" + "                            database(Property):\n" + "                                [X] db instance Database\n" + "                            name(Property):\n" + "                                [>3] default instance String\n" + "                            relations(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            tables(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            views(Property):\n" + "                    setColumns(Property):\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            nullable(Property):\n" + "                                [>3] false instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                        [_] Anonymous_StripedId instance Column\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] other instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] firmId instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                    temporaryTable(Property):\n" + "                        false instance Boolean\n" + "            type(Property):\n" + "                Anonymous_StripedId instance Varchar\n" + "                    size(Property):\n" + "                        200 instance Integer\n" + "    columnName(Property):\n" + "        name instance String\n" + "    setMappingOwner(Property):\n" + "        Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + "            class(Property):\n" + "                [~>] other::Person instance Class\n" + "            distinct(Property):\n" + "                false instance Boolean\n" + "            id(Property):\n" + "                other_Person instance String\n" + "            mainTableAlias(Property):\n" + "                Anonymous_StripedId instance TableAlias\n" + "                    database(Property):\n" + "                        [X] db instance Database\n" + "                    name(Property):\n" + "                         instance String\n" + "                    relationalElement(Property):\n" + "                        Anonymous_StripedId instance Table\n" + "                            columns(Property):\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                            milestoning(Property):\n" + "                            name(Property):\n" + "                                [>3] employeeTable instance String\n" + "                            primaryKey(Property):\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                            schema(Property):\n" + "                                [>3] Anonymous_StripedId instance Schema\n" + "                            setColumns(Property):\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                            temporaryTable(Property):\n" + "                                [>3] false instance Boolean\n" + "            parent(Property):\n" + "                [~>] mappingPackage::myMapping instance Mapping\n" + "            primaryKey(Property):\n" + "                Anonymous_StripedId instance TableAliasColumn\n" + "                    alias(Property):\n" + "                        Anonymous_StripedId instance TableAlias\n" + "                            database(Property):\n" + "                                [X] db instance Database\n" + "                            name(Property):\n" + "                                [>3]  instance String\n" + "                            relationalElement(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                    column(Property):\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            nullable(Property):\n" + "                                [>3] false instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "            propertyMappings(Property):\n" + "                Anonymous_StripedId instance RelationalPropertyMapping\n" + "                    localMappingProperty(Property):\n" + "                        false instance Boolean\n" + "                    owner(Property):\n" + "                        [_] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + "                    property(Property):\n" + "                        name instance Property\n" + "                            aggregation(Property):\n" + "                                [>3] None instance AggregationKind\n" + "                            classifierGenericType(Property):\n" + "                                [>3] Anonymous_StripedId instance GenericType\n" + "                            genericType(Property):\n" + "                                [>3] Anonymous_StripedId instance GenericType\n" + "                            multiplicity(Property):\n" + "                                [X] PureOne instance PackageableMultiplicity\n" + "                            name(Property):\n" + "                                [>3] name instance String\n" + "                            owner(Property):\n" + "                                [X] Person instance Class\n" + "                            referenceUsages(Property):\n" + "                                [>3] Anonymous_StripedId instance ReferenceUsage\n" + "                    relationalOperationElement(Property):\n" + "                        [_] Anonymous_StripedId instance TableAliasColumn\n" + "                    sourceSetImplementationId(Property):\n" + "                        other_Person instance String\n" + "                    targetSetImplementationId(Property):\n" + "                         instance String\n" + "                Anonymous_StripedId instance RelationalPropertyMapping\n" + "                    localMappingProperty(Property):\n" + "                        false instance Boolean\n" + "                    owner(Property):\n" + "                        [_] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + "                    property(Property):\n" + "                        id instance Property\n" + "                            aggregation(Property):\n" + "                                [>3] None instance AggregationKind\n" + "                            classifierGenericType(Property):\n" + "                                [>3] Anonymous_StripedId instance GenericType\n" + "                            genericType(Property):\n" + "                                [>3] Anonymous_StripedId instance GenericType\n" + "                            multiplicity(Property):\n" + "                                [X] PureOne instance PackageableMultiplicity\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            owner(Property):\n" + "                                [X] Person instance Class\n" + "                            referenceUsages(Property):\n" + "                                [>3] Anonymous_StripedId instance ReferenceUsage\n" + "                    relationalOperationElement(Property):\n" + "                        Anonymous_StripedId instance TableAliasColumn\n" + "                            alias(Property):\n" + "                                [>3] Anonymous_StripedId instance TableAlias\n" + "                            column(Property):\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                            columnName(Property):\n" + "                                [>3] id instance String\n" + "                            setMappingOwner(Property):\n" + "                                [>3] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + "                    sourceSetImplementationId(Property):\n" + "                        other_Person instance String\n" + "                    targetSetImplementationId(Property):\n" + "                         instance String\n" + "                Anonymous_StripedId instance RelationalPropertyMapping\n" + "                    localMappingProperty(Property):\n" + "                        false instance Boolean\n" + "                    owner(Property):\n" + "                        [_] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + "                    property(Property):\n" + "                        other instance Property\n" + "                            aggregation(Property):\n" + "                                [>3] None instance AggregationKind\n" + "                            classifierGenericType(Property):\n" + "                                [>3] Anonymous_StripedId instance GenericType\n" + "                            genericType(Property):\n" + "                                [>3] Anonymous_StripedId instance GenericType\n" + "                            multiplicity(Property):\n" + "                                [X] PureOne instance PackageableMultiplicity\n" + "                            name(Property):\n" + "                                [>3] other instance String\n" + "                            owner(Property):\n" + "                                [X] Person instance Class\n" + "                            referenceUsages(Property):\n" + "                                [>3] Anonymous_StripedId instance ReferenceUsage\n" + "                    relationalOperationElement(Property):\n" + "                        Anonymous_StripedId instance TableAliasColumn\n" + "                            alias(Property):\n" + "                                [>3] Anonymous_StripedId instance TableAlias\n" + "                            column(Property):\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                            columnName(Property):\n" + "                                [>3] other instance String\n" + "                            setMappingOwner(Property):\n" + "                                [>3] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + "                    sourceSetImplementationId(Property):\n" + "                        other_Person instance String\n" + "                    targetSetImplementationId(Property):\n" + "                         instance String\n" + "            root(Property):\n" + "                true instance Boolean\n" + "            stores(Property):\n" + "                [X] db instance Database\n" + "            userDefinedPrimaryKey(Property):\n" + "                false instance Boolean\n" + "Anonymous_StripedId instance TableAliasColumn\n" + "    alias(Property):\n" + "        Anonymous_StripedId instance TableAlias\n" + "            database(Property):\n" + "                [~>] db instance Database\n" + "            name(Property):\n" + "                employeeTable instance String\n" + "            relationalElement(Property):\n" + "                Anonymous_StripedId instance Table\n" + "                    columns(Property):\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            nullable(Property):\n" + "                                [>3] false instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] name instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] other instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] firmId instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                    milestoning(Property):\n" + "                    name(Property):\n" + "                        employeeTable instance String\n" + "                    primaryKey(Property):\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            nullable(Property):\n" + "                                [>3] false instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                    schema(Property):\n" + "                        Anonymous_StripedId instance Schema\n" + "                            database(Property):\n" + "                                [X] db instance Database\n" + "                            name(Property):\n" + "                                [>3] default instance String\n" + "                            relations(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            tables(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            views(Property):\n" + "                    setColumns(Property):\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            nullable(Property):\n" + "                                [>3] false instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] name instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] other instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] firmId instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                    temporaryTable(Property):\n" + "                        false instance Boolean\n" + "            schema(Property):\n" + "                default instance String\n" + "    column(Property):\n" + "        Anonymous_StripedId instance Column\n" + "            name(Property):\n" + "                id instance String\n" + "            nullable(Property):\n" + "                false instance Boolean\n" + "            owner(Property):\n" + "                Anonymous_StripedId instance Table\n" + "                    columns(Property):\n" + "                        [_] Anonymous_StripedId instance Column\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] name instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] other instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] firmId instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                    milestoning(Property):\n" + "                    name(Property):\n" + "                        employeeTable instance String\n" + "                    primaryKey(Property):\n" + "                        [_] Anonymous_StripedId instance Column\n" + "                    schema(Property):\n" + "                        Anonymous_StripedId instance Schema\n" + "                            database(Property):\n" + "                                [X] db instance Database\n" + "                            name(Property):\n" + "                                [>3] default instance String\n" + "                            relations(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            tables(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            views(Property):\n" + "                    setColumns(Property):\n" + "                        [_] Anonymous_StripedId instance Column\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] name instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] other instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] firmId instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                    temporaryTable(Property):\n" + "                        false instance Boolean\n" + "            type(Property):\n" + "                Anonymous_StripedId instance Integer\n" + "    columnName(Property):\n" + "        id instance String\n" + "    setMappingOwner(Property):\n" + "        Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + "            class(Property):\n" + "                [~>] other::Person instance Class\n" + "            distinct(Property):\n" + "                false instance Boolean\n" + "            id(Property):\n" + "                other_Person instance String\n" + "            mainTableAlias(Property):\n" + "                Anonymous_StripedId instance TableAlias\n" + "                    database(Property):\n" + "                        [X] db instance Database\n" + "                    name(Property):\n" + "                         instance String\n" + "                    relationalElement(Property):\n" + "                        Anonymous_StripedId instance Table\n" + "                            columns(Property):\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                            milestoning(Property):\n" + "                            name(Property):\n" + "                                [>3] employeeTable instance String\n" + "                            primaryKey(Property):\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                            schema(Property):\n" + "                                [>3] Anonymous_StripedId instance Schema\n" + "                            setColumns(Property):\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                            temporaryTable(Property):\n" + "                                [>3] false instance Boolean\n" + "            parent(Property):\n" + "                [~>] mappingPackage::myMapping instance Mapping\n" + "            primaryKey(Property):\n" + "                Anonymous_StripedId instance TableAliasColumn\n" + "                    alias(Property):\n" + "                        Anonymous_StripedId instance TableAlias\n" + "                            database(Property):\n" + "                                [X] db instance Database\n" + "                            name(Property):\n" + "                                [>3]  instance String\n" + "                            relationalElement(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                    column(Property):\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            nullable(Property):\n" + "                                [>3] false instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "            propertyMappings(Property):\n" + "                Anonymous_StripedId instance RelationalPropertyMapping\n" + "                    localMappingProperty(Property):\n" + "                        false instance Boolean\n" + "                    owner(Property):\n" + "                        [_] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + "                    property(Property):\n" + "                        name instance Property\n" + "                            aggregation(Property):\n" + "                                [>3] None instance AggregationKind\n" + "                            classifierGenericType(Property):\n" + "                                [>3] Anonymous_StripedId instance GenericType\n" + "                            genericType(Property):\n" + "                                [>3] Anonymous_StripedId instance GenericType\n" + "                            multiplicity(Property):\n" + "                                [X] PureOne instance PackageableMultiplicity\n" + "                            name(Property):\n" + "                                [>3] name instance String\n" + "                            owner(Property):\n" + "                                [X] Person instance Class\n" + "                            referenceUsages(Property):\n" + "                                [>3] Anonymous_StripedId instance ReferenceUsage\n" + "                    relationalOperationElement(Property):\n" + "                        Anonymous_StripedId instance TableAliasColumn\n" + "                            alias(Property):\n" + "                                [>3] Anonymous_StripedId instance TableAlias\n" + "                            column(Property):\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                            columnName(Property):\n" + "                                [>3] name instance String\n" + "                            setMappingOwner(Property):\n" + "                                [>3] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + "                    sourceSetImplementationId(Property):\n" + "                        other_Person instance String\n" + "                    targetSetImplementationId(Property):\n" + "                         instance String\n" + "                Anonymous_StripedId instance RelationalPropertyMapping\n" + "                    localMappingProperty(Property):\n" + "                        false instance Boolean\n" + "                    owner(Property):\n" + "                        [_] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + "                    property(Property):\n" + "                        id instance Property\n" + "                            aggregation(Property):\n" + "                                [>3] None instance AggregationKind\n" + "                            classifierGenericType(Property):\n" + "                                [>3] Anonymous_StripedId instance GenericType\n" + "                            genericType(Property):\n" + "                                [>3] Anonymous_StripedId instance GenericType\n" + "                            multiplicity(Property):\n" + "                                [X] PureOne instance PackageableMultiplicity\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            owner(Property):\n" + "                                [X] Person instance Class\n" + "                            referenceUsages(Property):\n" + "                                [>3] Anonymous_StripedId instance ReferenceUsage\n" + "                    relationalOperationElement(Property):\n" + "                        [_] Anonymous_StripedId instance TableAliasColumn\n" + "                    sourceSetImplementationId(Property):\n" + "                        other_Person instance String\n" + "                    targetSetImplementationId(Property):\n" + "                         instance String\n" + "                Anonymous_StripedId instance RelationalPropertyMapping\n" + "                    localMappingProperty(Property):\n" + "                        false instance Boolean\n" + "                    owner(Property):\n" + "                        [_] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + "                    property(Property):\n" + "                        other instance Property\n" + "                            aggregation(Property):\n" + "                                [>3] None instance AggregationKind\n" + "                            classifierGenericType(Property):\n" + "                                [>3] Anonymous_StripedId instance GenericType\n" + "                            genericType(Property):\n" + "                                [>3] Anonymous_StripedId instance GenericType\n" + "                            multiplicity(Property):\n" + "                                [X] PureOne instance PackageableMultiplicity\n" + "                            name(Property):\n" + "                                [>3] other instance String\n" + "                            owner(Property):\n" + "                                [X] Person instance Class\n" + "                            referenceUsages(Property):\n" + "                                [>3] Anonymous_StripedId instance ReferenceUsage\n" + "                    relationalOperationElement(Property):\n" + "                        Anonymous_StripedId instance TableAliasColumn\n" + "                            alias(Property):\n" + "                                [>3] Anonymous_StripedId instance TableAlias\n" + "                            column(Property):\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                            columnName(Property):\n" + "                                [>3] other instance String\n" + "                            setMappingOwner(Property):\n" + "                                [>3] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + "                    sourceSetImplementationId(Property):\n" + "                        other_Person instance String\n" + "                    targetSetImplementationId(Property):\n" + "                         instance String\n" + "            root(Property):\n" + "                true instance Boolean\n" + "            stores(Property):\n" + "                [X] db instance Database\n" + "            userDefinedPrimaryKey(Property):\n" + "                false instance Boolean\n" + "Anonymous_StripedId instance TableAliasColumn\n" + "    alias(Property):\n" + "        Anonymous_StripedId instance TableAlias\n" + "            database(Property):\n" + "                [~>] db instance Database\n" + "            name(Property):\n" + "                employeeTable instance String\n" + "            relationalElement(Property):\n" + "                Anonymous_StripedId instance Table\n" + "                    columns(Property):\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            nullable(Property):\n" + "                                [>3] false instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] name instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] other instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] firmId instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                    milestoning(Property):\n" + "                    name(Property):\n" + "                        employeeTable instance String\n" + "                    primaryKey(Property):\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            nullable(Property):\n" + "                                [>3] false instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                    schema(Property):\n" + "                        Anonymous_StripedId instance Schema\n" + "                            database(Property):\n" + "                                [X] db instance Database\n" + "                            name(Property):\n" + "                                [>3] default instance String\n" + "                            relations(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            tables(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            views(Property):\n" + "                    setColumns(Property):\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            nullable(Property):\n" + "                                [>3] false instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] name instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] other instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] firmId instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                    temporaryTable(Property):\n" + "                        false instance Boolean\n" + "    column(Property):\n" + "        Anonymous_StripedId instance Column\n" + "            name(Property):\n" + "                other instance String\n" + "            nullable(Property):\n" + "                true instance Boolean\n" + "            owner(Property):\n" + "                Anonymous_StripedId instance Table\n" + "                    columns(Property):\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            nullable(Property):\n" + "                                [>3] false instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] name instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        [_] Anonymous_StripedId instance Column\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] firmId instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                    milestoning(Property):\n" + "                    name(Property):\n" + "                        employeeTable instance String\n" + "                    primaryKey(Property):\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            nullable(Property):\n" + "                                [>3] false instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                    schema(Property):\n" + "                        Anonymous_StripedId instance Schema\n" + "                            database(Property):\n" + "                                [X] db instance Database\n" + "                            name(Property):\n" + "                                [>3] default instance String\n" + "                            relations(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            tables(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            views(Property):\n" + "                    setColumns(Property):\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            nullable(Property):\n" + "                                [>3] false instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] name instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Varchar\n" + "                        [_] Anonymous_StripedId instance Column\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] firmId instance String\n" + "                            nullable(Property):\n" + "                                [>3] true instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "                    temporaryTable(Property):\n" + "                        false instance Boolean\n" + "            type(Property):\n" + "                Anonymous_StripedId instance Varchar\n" + "                    size(Property):\n" + "                        200 instance Integer\n" + "    columnName(Property):\n" + "        other instance String\n" + "    setMappingOwner(Property):\n" + "        Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + "            class(Property):\n" + "                [~>] other::Person instance Class\n" + "            distinct(Property):\n" + "                false instance Boolean\n" + "            id(Property):\n" + "                other_Person instance String\n" + "            mainTableAlias(Property):\n" + "                Anonymous_StripedId instance TableAlias\n" + "                    database(Property):\n" + "                        [X] db instance Database\n" + "                    name(Property):\n" + "                         instance String\n" + "                    relationalElement(Property):\n" + "                        Anonymous_StripedId instance Table\n" + "                            columns(Property):\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                            milestoning(Property):\n" + "                            name(Property):\n" + "                                [>3] employeeTable instance String\n" + "                            primaryKey(Property):\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                            schema(Property):\n" + "                                [>3] Anonymous_StripedId instance Schema\n" + "                            setColumns(Property):\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                            temporaryTable(Property):\n" + "                                [>3] false instance Boolean\n" + "            parent(Property):\n" + "                [~>] mappingPackage::myMapping instance Mapping\n" + "            primaryKey(Property):\n" + "                Anonymous_StripedId instance TableAliasColumn\n" + "                    alias(Property):\n" + "                        Anonymous_StripedId instance TableAlias\n" + "                            database(Property):\n" + "                                [X] db instance Database\n" + "                            name(Property):\n" + "                                [>3]  instance String\n" + "                            relationalElement(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                    column(Property):\n" + "                        Anonymous_StripedId instance Column\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            nullable(Property):\n" + "                                [>3] false instance Boolean\n" + "                            owner(Property):\n" + "                                [>3] Anonymous_StripedId instance Table\n" + "                            type(Property):\n" + "                                [>3] Anonymous_StripedId instance Integer\n" + "            propertyMappings(Property):\n" + "                Anonymous_StripedId instance RelationalPropertyMapping\n" + "                    localMappingProperty(Property):\n" + "                        false instance Boolean\n" + "                    owner(Property):\n" + "                        [_] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + "                    property(Property):\n" + "                        name instance Property\n" + "                            aggregation(Property):\n" + "                                [>3] None instance AggregationKind\n" + "                            classifierGenericType(Property):\n" + "                                [>3] Anonymous_StripedId instance GenericType\n" + "                            genericType(Property):\n" + "                                [>3] Anonymous_StripedId instance GenericType\n" + "                            multiplicity(Property):\n" + "                                [X] PureOne instance PackageableMultiplicity\n" + "                            name(Property):\n" + "                                [>3] name instance String\n" + "                            owner(Property):\n" + "                                [X] Person instance Class\n" + "                            referenceUsages(Property):\n" + "                                [>3] Anonymous_StripedId instance ReferenceUsage\n" + "                    relationalOperationElement(Property):\n" + "                        Anonymous_StripedId instance TableAliasColumn\n" + "                            alias(Property):\n" + "                                [>3] Anonymous_StripedId instance TableAlias\n" + "                            column(Property):\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                            columnName(Property):\n" + "                                [>3] name instance String\n" + "                            setMappingOwner(Property):\n" + "                                [>3] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + "                    sourceSetImplementationId(Property):\n" + "                        other_Person instance String\n" + "                    targetSetImplementationId(Property):\n" + "                         instance String\n" + "                Anonymous_StripedId instance RelationalPropertyMapping\n" + "                    localMappingProperty(Property):\n" + "                        false instance Boolean\n" + "                    owner(Property):\n" + "                        [_] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + "                    property(Property):\n" + "                        id instance Property\n" + "                            aggregation(Property):\n" + "                                [>3] None instance AggregationKind\n" + "                            classifierGenericType(Property):\n" + "                                [>3] Anonymous_StripedId instance GenericType\n" + "                            genericType(Property):\n" + "                                [>3] Anonymous_StripedId instance GenericType\n" + "                            multiplicity(Property):\n" + "                                [X] PureOne instance PackageableMultiplicity\n" + "                            name(Property):\n" + "                                [>3] id instance String\n" + "                            owner(Property):\n" + "                                [X] Person instance Class\n" + "                            referenceUsages(Property):\n" + "                                [>3] Anonymous_StripedId instance ReferenceUsage\n" + "                    relationalOperationElement(Property):\n" + "                        Anonymous_StripedId instance TableAliasColumn\n" + "                            alias(Property):\n" + "                                [>3] Anonymous_StripedId instance TableAlias\n" + "                            column(Property):\n" + "                                [>3] Anonymous_StripedId instance Column\n" + "                            columnName(Property):\n" + "                                [>3] id instance String\n" + "                            setMappingOwner(Property):\n" + "                                [>3] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + "                    sourceSetImplementationId(Property):\n" + "                        other_Person instance String\n" + "                    targetSetImplementationId(Property):\n" + "                         instance String\n" + "                Anonymous_StripedId instance RelationalPropertyMapping\n" + "                    localMappingProperty(Property):\n" + "                        false instance Boolean\n" + "                    owner(Property):\n" + "                        [_] Anonymous_StripedId instance RootRelationalInstanceSetImplementation\n" + "                    property(Property):\n" + "                        other instance Property\n" + "                            aggregation(Property):\n" + "                                [>3] None instance AggregationKind\n" + "                            classifierGenericType(Property):\n" + "                                [>3] Anonymous_StripedId instance GenericType\n" + "                            genericType(Property):\n" + "                                [>3] Anonymous_StripedId instance GenericType\n" + "                            multiplicity(Property):\n" + "                                [X] PureOne instance PackageableMultiplicity\n" + "                            name(Property):\n" + "                                [>3] other instance String\n" + "                            owner(Property):\n" + "                                [X] Person instance Class\n" + "                            referenceUsages(Property):\n" + "                                [>3] Anonymous_StripedId instance ReferenceUsage\n" + "                    relationalOperationElement(Property):\n" + "                        [_] Anonymous_StripedId instance TableAliasColumn\n" + "                    sourceSetImplementationId(Property):\n" + "                        other_Person instance String\n" + "                    targetSetImplementationId(Property):\n" + "                         instance String\n" + "            root(Property):\n" + "                true instance Boolean\n" + "            stores(Property):\n" + "                [X] db instance Database\n" + "            userDefinedPrimaryKey(Property):\n" + "                false instance Boolean\n" + "]", mappingGraphDump);
}
Also used : EnumerationMappingParser(org.finos.legend.pure.m2.dsl.mapping.serialization.grammar.v1.EnumerationMappingParser) MappingParser(org.finos.legend.pure.m2.dsl.mapping.serialization.grammar.v1.MappingParser) ParserLibrary(org.finos.legend.pure.m3.serialization.grammar.ParserLibrary) M3AntlrParser(org.finos.legend.pure.m3.serialization.grammar.m3parser.antlr.M3AntlrParser) CoreInstance(org.finos.legend.pure.m4.coreinstance.CoreInstance) RelationalParser(org.finos.legend.pure.m2.relational.serialization.grammar.v1.RelationalParser) Test(org.junit.Test)

Example 2 with TableAliasColumn

use of org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.TableAliasColumn in project legend-pure by finos.

the class RelationalOperationElementProcessor method processColumnExpr.

static void processColumnExpr(RelationalOperationElement impl, CoreInstance implementation, CoreInstance mappingOwner, MutableSet<TableAlias> tableAliases, Matcher matcher, ProcessorState state, ModelRepository repository, ProcessorSupport processorSupport) throws PureCompilationException {
    if (impl instanceof TableAliasColumn) {
        processTableAliasColumn((TableAliasColumn) impl, mappingOwner, tableAliases, processorSupport);
    } else if (impl instanceof DynaFunction) {
        processDynaFunction((DynaFunction) impl, implementation, mappingOwner, tableAliases, matcher, state, repository, processorSupport);
    } else if (impl instanceof RelationalOperationElementWithJoin) {
        RelationalOperationElement relationalOperationElement = ((RelationalOperationElementWithJoin) impl)._relationalOperationElement();
        if (relationalOperationElement != null) {
            if (relationalOperationElement instanceof DynaFunction) {
                processDynaFunction((DynaFunction) relationalOperationElement, implementation, mappingOwner, tableAliases, matcher, state, repository, processorSupport);
            } else if (relationalOperationElement instanceof TableAliasColumn) {
                processTableAliasColumn((TableAliasColumn) relationalOperationElement, mappingOwner, tableAliases, processorSupport);
            }
        }
        JoinTreeNode joinTreeNode = ((RelationalOperationElementWithJoin) impl)._joinTreeNode();
        if (joinTreeNode != null) {
            processJoinTreeNode(joinTreeNode, mappingOwner, matcher, state, repository, processorSupport);
            tableAliases.clear();
        }
    } else if (impl instanceof Literal) {
    // Do nothing
    } else {
        throw new PureCompilationException(impl.getSourceInformation(), "Not Supported Yet! " + impl);
    }
}
Also used : RelationalOperationElement(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.RelationalOperationElement) Literal(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.Literal) JoinTreeNode(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.join.JoinTreeNode) TableAliasColumn(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.TableAliasColumn) DynaFunction(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.DynaFunction) RelationalOperationElementWithJoin(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.RelationalOperationElementWithJoin) PureCompilationException(org.finos.legend.pure.m4.exception.PureCompilationException)

Example 3 with TableAliasColumn

use of org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.TableAliasColumn in project legend-pure by finos.

the class DatabaseUnloadUnbind method processTableAliasColumn.

private static void processTableAliasColumn(TableAliasColumn tableAliasColumn, TableAlias joinTarget, ProcessorSupport processorSupport) throws PureCompilationException {
    TableAlias tableAlias = tableAliasColumn._alias();
    if ((joinTarget != null) && (tableAlias == joinTarget)) {
        // Replace the join target with a {target} alias
        ModelRepository repository = tableAliasColumn.getRepository();
        TableAlias targetAlias = (TableAlias) repository.newAnonymousCoreInstance(tableAliasColumn.getSourceInformation(), joinTarget.getClassifier());
        targetAlias._name(DatabaseProcessor.SELF_JOIN_TABLE_NAME);
        tableAliasColumn._alias(targetAlias);
    } else {
        tableAlias._relationalElementRemove();
        ImportStub tableAliasDatabase = (ImportStub) tableAlias._databaseCoreInstance();
        if (tableAliasDatabase != null) {
            Shared.cleanImportStub(tableAliasDatabase, processorSupport);
        }
    }
    tableAliasColumn._columnRemove();
}
Also used : ModelRepository(org.finos.legend.pure.m4.ModelRepository) TableAlias(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.TableAlias) ImportStub(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.ImportStub)

Example 4 with TableAliasColumn

use of org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.TableAliasColumn in project legend-pure by finos.

the class RelationalOperationElementUnbind method cleanNode.

public static void cleanNode(RelationalOperationElement element, ModelRepository modelRepository, ProcessorSupport processorSupport) throws PureCompilationException {
    if (element instanceof TableAliasColumn) {
        TableAliasColumn tableAliasColumn = (TableAliasColumn) element;
        ImportStub database = (ImportStub) tableAliasColumn._alias()._databaseCoreInstance();
        Shared.cleanUpReferenceUsage(database, tableAliasColumn, processorSupport);
        Shared.cleanImportStub(database, processorSupport);
        tableAliasColumn._columnRemove();
        TableAlias alias = tableAliasColumn._alias();
        alias._relationalElementRemove();
    } else if (element instanceof DynaFunction) {
        for (RelationalOperationElement val : ((DynaFunction) element)._parameters()) {
            cleanNode(val, modelRepository, processorSupport);
        }
    } else if (element instanceof RelationalOperationElementWithJoin) {
        if (((RelationalOperationElementWithJoin) element)._relationalOperationElement() != null) {
            cleanNode(((RelationalOperationElementWithJoin) element)._relationalOperationElement(), modelRepository, processorSupport);
        }
        if (((RelationalOperationElementWithJoin) element)._joinTreeNode() != null) {
            cleanJoinTreeNode(((RelationalOperationElementWithJoin) element)._joinTreeNode(), modelRepository, processorSupport);
        }
    } else if (element instanceof Literal) {
    // Nothing to do
    } else {
        throw new RuntimeException("TO CODE: clean relational operation element node of type " + PackageableElement.getUserPathForPackageableElement(element.getClassifier()));
    }
}
Also used : RelationalOperationElement(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.RelationalOperationElement) Literal(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.Literal) TableAlias(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.TableAlias) TableAliasColumn(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.TableAliasColumn) ImportStub(org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel._import.ImportStub) DynaFunction(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.DynaFunction) RelationalOperationElementWithJoin(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.RelationalOperationElementWithJoin)

Example 5 with TableAliasColumn

use of org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.TableAliasColumn in project legend-pure by finos.

the class DatabaseProcessor method processFilter.

private void processFilter(Filter filter, Database defaultDb, ProcessorSupport processorSupport) throws PureCompilationException {
    MutableMap<String, MutableMap<String, CoreInstance>> tableByAlias = UnifiedMap.newMap();
    Operation operation = filter._operation();
    MutableList<TableAliasColumn> selfJoinTarget = FastList.newList();
    scanOperation(operation, tableByAlias, selfJoinTarget, defaultDb, null, processorSupport, false);
}
Also used : MutableMap(org.eclipse.collections.api.map.MutableMap) UnaryOperation(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.operation.UnaryOperation) BinaryOperation(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.operation.BinaryOperation) Operation(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.operation.Operation) TableAliasColumn(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.TableAliasColumn)

Aggregations

TableAliasColumn (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.TableAliasColumn)12 RelationalOperationElement (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.RelationalOperationElement)8 TableAlias (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.TableAlias)8 Column (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.Column)7 CoreInstance (org.finos.legend.pure.m4.coreinstance.CoreInstance)6 DynaFunction (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.DynaFunction)5 NamedRelation (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.relation.NamedRelation)5 Relation (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.relation.Relation)5 Table (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.relation.Table)5 PureCompilationException (org.finos.legend.pure.m4.exception.PureCompilationException)5 Database (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.Database)4 Literal (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.Literal)4 RelationalOperationElementWithJoin (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.RelationalOperationElementWithJoin)4 JoinTreeNode (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.join.JoinTreeNode)4 RichIterable (org.eclipse.collections.api.RichIterable)3 Function (org.eclipse.collections.api.block.function.Function)3 MutableMap (org.eclipse.collections.api.map.MutableMap)3 Operation (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.operation.Operation)3 View (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.relation.View)3 Root_meta_relational_metamodel_TableAliasColumn_Impl (org.finos.legend.pure.generated.Root_meta_relational_metamodel_TableAliasColumn_Impl)2