Search in sources :

Example 1 with RelationalPropertyMapping

use of org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.RelationalPropertyMapping 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 RelationalPropertyMapping

use of org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.RelationalPropertyMapping in project legend-pure by finos.

the class RelationalPropertyMappingProcessor method collectJoinTreeNodes.

private static void collectJoinTreeNodes(Collection<? super JoinTreeNode> targetCollection, PropertyMapping propertyMapping) {
    if (propertyMapping instanceof RelationalPropertyMapping) {
        RelationalOperationElement relationalOperationElement = ((RelationalPropertyMapping) propertyMapping)._relationalOperationElement();
        RelationalOperationElementProcessor.collectJoinTreeNodes(targetCollection, relationalOperationElement);
    }
    if (propertyMapping instanceof OtherwiseEmbeddedRelationalInstanceSetImplementation) {
        PropertyMapping relationalOperationElement = ((OtherwiseEmbeddedRelationalInstanceSetImplementation) propertyMapping)._otherwisePropertyMapping();
        collectJoinTreeNodes(targetCollection, relationalOperationElement);
    }
    if (propertyMapping instanceof PropertyMappingsImplementation) {
        RichIterable<? extends PropertyMapping> propertyMappings = ((PropertyMappingsImplementation) propertyMapping)._propertyMappings();
        for (PropertyMapping subMapping : propertyMappings) {
            collectJoinTreeNodes(targetCollection, subMapping);
        }
    }
}
Also used : RelationalPropertyMapping(org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.RelationalPropertyMapping) OtherwiseEmbeddedRelationalInstanceSetImplementation(org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.OtherwiseEmbeddedRelationalInstanceSetImplementation) RelationalOperationElement(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.RelationalOperationElement) PropertyMapping(org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.PropertyMapping) RelationalPropertyMapping(org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.RelationalPropertyMapping) PropertyMappingsImplementation(org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.PropertyMappingsImplementation)

Example 3 with RelationalPropertyMapping

use of org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.RelationalPropertyMapping in project legend-pure by finos.

the class RelationalPropertyMappingProcessor method populateReferenceUsagesForRelationalPropertyMapping.

static void populateReferenceUsagesForRelationalPropertyMapping(PropertyMapping propertyMapping, ModelRepository repository, ProcessorSupport processorSupport) {
    if (propertyMapping instanceof EmbeddedRelationalInstanceSetImplementation) {
        EmbeddedRelationalInstanceSetImplementation embeddedRelationalInstanceSetImplementation = (EmbeddedRelationalInstanceSetImplementation) propertyMapping;
        RichIterable<? extends PropertyMapping> embeddedPropertyMappings = embeddedRelationalInstanceSetImplementation._propertyMappings();
        populateReferenceUsagesForRelationalPropertyMappings(embeddedPropertyMappings, repository, processorSupport);
        RelationalInstanceSetImplementationProcessor.populateReferenceUsagesForUserDefinedPrimaryKey(propertyMapping, repository, processorSupport);
        if (propertyMapping instanceof OtherwiseEmbeddedRelationalInstanceSetImplementation) {
            OtherwiseEmbeddedRelationalInstanceSetImplementation otherwiseEmbeddedRelationalInstanceSetImplementation = (OtherwiseEmbeddedRelationalInstanceSetImplementation) embeddedRelationalInstanceSetImplementation;
            PropertyMapping otherwiseEmbeddedPropertyMappings = otherwiseEmbeddedRelationalInstanceSetImplementation._otherwisePropertyMapping();
            populateReferenceUsagesForRelationalPropertyMapping(otherwiseEmbeddedPropertyMappings, repository, processorSupport);
        }
    } else {
        if (propertyMapping instanceof RelationalPropertyMapping) {
            RelationalOperationElement columnExpression = ((RelationalPropertyMapping) propertyMapping)._relationalOperationElement();
            RelationalOperationElementProcessor.populateColumnExpressionReferenceUsages(columnExpression, repository, processorSupport);
        }
    }
}
Also used : OtherwiseEmbeddedRelationalInstanceSetImplementation(org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.OtherwiseEmbeddedRelationalInstanceSetImplementation) EmbeddedRelationalInstanceSetImplementation(org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.EmbeddedRelationalInstanceSetImplementation) OtherwiseEmbeddedRelationalInstanceSetImplementation(org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.OtherwiseEmbeddedRelationalInstanceSetImplementation) RelationalPropertyMapping(org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.RelationalPropertyMapping) RelationalOperationElement(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.RelationalOperationElement) PropertyMapping(org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.PropertyMapping) RelationalPropertyMapping(org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.RelationalPropertyMapping)

Example 4 with RelationalPropertyMapping

use of org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.RelationalPropertyMapping in project legend-pure by finos.

the class TestMilestoningPropertyMapping method testProcessingMilestoningPropertyMapping.

@Test
public void testProcessingMilestoningPropertyMapping() {
    this.runtime.createInMemorySource(MODEL_ID, PROCESSING_MILESTONING_MODEL_CODE);
    this.runtime.createInMemorySource(STORE_ID, MILESTONED_STORE_CODE);
    this.runtime.createInMemorySource(MAPPING_ID, MAPPING_CODE);
    this.runtime.compile();
    Mapping mapping = (Mapping) this.runtime.getCoreInstance("milestoning::Amap");
    RootRelationalInstanceSetImplementation rootRelationalInstanceSetImplementation = mapping._classMappings().selectInstancesOf(RootRelationalInstanceSetImplementation.class).getFirst();
    EmbeddedRelationalInstanceSetImplementation milestoningEmbeddedRelationalInstance = (EmbeddedRelationalInstanceSetImplementation) rootRelationalInstanceSetImplementation._propertyMappings().detectWith(MILESTONING_PROPERTY_MAPPING, this.processorSupport);
    Assert.assertNotNull(milestoningEmbeddedRelationalInstance);
    validateProperty(milestoningEmbeddedRelationalInstance._property(), "milestoning", "milestoning::A");
    MutableList<RelationalPropertyMapping> relationalPropertyMappings = (MutableList<RelationalPropertyMapping>) milestoningEmbeddedRelationalInstance._propertyMappings().toList();
    Assert.assertEquals(2, relationalPropertyMappings.size());
    RelationalPropertyMapping inPropertyMapping = relationalPropertyMappings.get(0);
    validateProperty(inPropertyMapping._property(), "in", "meta::pure::milestoning::ProcessingDateMilestoning");
    validateTableAliasColumn(inPropertyMapping._relationalOperationElement(), "in_z");
    RelationalPropertyMapping outPropertyMapping = relationalPropertyMappings.get(1);
    validateProperty(outPropertyMapping._property(), "out", "meta::pure::milestoning::ProcessingDateMilestoning");
    validateTableAliasColumn(outPropertyMapping._relationalOperationElement(), "out_z");
}
Also used : EmbeddedRelationalInstanceSetImplementation(org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.EmbeddedRelationalInstanceSetImplementation) RelationalPropertyMapping(org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.RelationalPropertyMapping) MutableList(org.eclipse.collections.api.list.MutableList) RootRelationalInstanceSetImplementation(org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.RootRelationalInstanceSetImplementation) PropertyMapping(org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.PropertyMapping) Mapping(org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.Mapping) RelationalPropertyMapping(org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.RelationalPropertyMapping) Test(org.junit.Test)

Example 5 with RelationalPropertyMapping

use of org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.RelationalPropertyMapping in project legend-pure by finos.

the class TestMilestoningPropertyMapping method testBusinessMilestoningPropertyMappingForTemporalEmbedded.

@Test
public void testBusinessMilestoningPropertyMappingForTemporalEmbedded() {
    this.runtime.createInMemorySource(MODEL_ID, BUSINESS_MILESTONING_MODEL_CODE);
    this.runtime.createInMemorySource(EMBEDDED_MODEL_ID, TEMPORAL_EMBEDDED_MODEL_CODE);
    this.runtime.createInMemorySource(STORE_ID, MILESTONED_STORE_CODE);
    this.runtime.createInMemorySource(MAPPING_ID, EMBEDDED_MAPPING_CODE);
    this.runtime.compile();
    Mapping mapping = (Mapping) this.runtime.getCoreInstance("milestoning::Bmap");
    RootRelationalInstanceSetImplementation rootRelationalInstance = mapping._classMappings().selectInstancesOf(RootRelationalInstanceSetImplementation.class).getFirst();
    EmbeddedRelationalInstanceSetImplementation milestoningEmbeddedRelationalInstance = (EmbeddedRelationalInstanceSetImplementation) rootRelationalInstance._propertyMappings().detectWith(MILESTONING_PROPERTY_MAPPING, this.processorSupport);
    Assert.assertNotNull(milestoningEmbeddedRelationalInstance);
    validateProperty(milestoningEmbeddedRelationalInstance._property(), "milestoning", "milestoning::B");
    MutableList<RelationalPropertyMapping> relationalPropertyMappings = (MutableList<RelationalPropertyMapping>) milestoningEmbeddedRelationalInstance._propertyMappings().toList();
    Assert.assertEquals(2, relationalPropertyMappings.size());
    RelationalPropertyMapping fromPropertyMapping = relationalPropertyMappings.get(0);
    validateProperty(fromPropertyMapping._property(), "from", "meta::pure::milestoning::BusinessDateMilestoning");
    validateTableAliasColumn(fromPropertyMapping._relationalOperationElement(), "from_z");
    RelationalPropertyMapping thruPropertyMapping = relationalPropertyMappings.get(1);
    validateProperty(thruPropertyMapping._property(), "thru", "meta::pure::milestoning::BusinessDateMilestoning");
    validateTableAliasColumn(thruPropertyMapping._relationalOperationElement(), "thru_z");
    EmbeddedRelationalInstanceSetImplementation embeddedRelationalInstance = rootRelationalInstance._propertyMappings().selectInstancesOf(EmbeddedRelationalInstanceSetImplementation.class).getFirst();
    milestoningEmbeddedRelationalInstance = (EmbeddedRelationalInstanceSetImplementation) embeddedRelationalInstance._propertyMappings().detectWith(MILESTONING_PROPERTY_MAPPING, this.processorSupport);
    Assert.assertNotNull(milestoningEmbeddedRelationalInstance);
    validateProperty(milestoningEmbeddedRelationalInstance._property(), "milestoning", "milestoning::A");
    relationalPropertyMappings = (MutableList<RelationalPropertyMapping>) milestoningEmbeddedRelationalInstance._propertyMappings().toList();
    Assert.assertEquals(2, relationalPropertyMappings.size());
    fromPropertyMapping = relationalPropertyMappings.get(0);
    validateProperty(fromPropertyMapping._property(), "from", "meta::pure::milestoning::BusinessDateMilestoning");
    validateTableAliasColumn(fromPropertyMapping._relationalOperationElement(), "from_z");
    thruPropertyMapping = relationalPropertyMappings.get(1);
    validateProperty(thruPropertyMapping._property(), "thru", "meta::pure::milestoning::BusinessDateMilestoning");
    validateTableAliasColumn(thruPropertyMapping._relationalOperationElement(), "thru_z");
}
Also used : EmbeddedRelationalInstanceSetImplementation(org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.EmbeddedRelationalInstanceSetImplementation) RelationalPropertyMapping(org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.RelationalPropertyMapping) MutableList(org.eclipse.collections.api.list.MutableList) RootRelationalInstanceSetImplementation(org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.RootRelationalInstanceSetImplementation) PropertyMapping(org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.PropertyMapping) Mapping(org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.Mapping) RelationalPropertyMapping(org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.RelationalPropertyMapping) Test(org.junit.Test)

Aggregations

PropertyMapping (org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.PropertyMapping)17 RelationalPropertyMapping (org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.RelationalPropertyMapping)17 EmbeddedRelationalInstanceSetImplementation (org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.EmbeddedRelationalInstanceSetImplementation)16 RootRelationalInstanceSetImplementation (org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.RootRelationalInstanceSetImplementation)15 Mapping (org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.Mapping)14 Test (org.junit.Test)13 MutableList (org.eclipse.collections.api.list.MutableList)12 RelationalOperationElement (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.RelationalOperationElement)8 OtherwiseEmbeddedRelationalInstanceSetImplementation (org.finos.legend.pure.m3.coreinstance.meta.relational.mapping.OtherwiseEmbeddedRelationalInstanceSetImplementation)5 CoreInstance (org.finos.legend.pure.m4.coreinstance.CoreInstance)4 SetImplementation (org.finos.legend.pure.m3.coreinstance.meta.pure.mapping.SetImplementation)3 Type (org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.type.Type)3 RelationalOperationElementWithJoin (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.RelationalOperationElementWithJoin)3 PureCompilationException (org.finos.legend.pure.m4.exception.PureCompilationException)3 EngineErrorType (org.finos.legend.engine.protocol.pure.v1.model.context.EngineErrorType)2 DataType (org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.relational.model.datatype.DataType)2 EngineException (org.finos.legend.engine.shared.core.operational.errorManagement.EngineException)2 Root_meta_external_shared_format_binding_Binding (org.finos.legend.pure.generated.Root_meta_external_shared_format_binding_Binding)2 Root_meta_external_shared_format_binding_BindingTransformer_Impl (org.finos.legend.pure.generated.Root_meta_external_shared_format_binding_BindingTransformer_Impl)2 Root_meta_external_shared_format_binding_validation_BindingDetail (org.finos.legend.pure.generated.Root_meta_external_shared_format_binding_validation_BindingDetail)2