????

Your IP : 3.16.139.36


Current Path : C:/inetpub/vhost/invest.gdtsolutions.vn/api/node_modules/typeorm/metadata/
Upload File :
Current File : C:/inetpub/vhost/invest.gdtsolutions.vn/api/node_modules/typeorm/metadata/RelationMetadata.js.map

{"version":3,"sources":["../../src/metadata/RelationMetadata.ts"],"names":[],"mappings":";;;AACA,qDAAiD;AAUjD,oCAAuC;AACvC,qDAAiD;AACjD,6DAAyD;AAEzD;;GAEG;AACH,MAAa,gBAAgB;IAqQzB,wEAAwE;IACxE,cAAc;IACd,wEAAwE;IAExE,YAAY,OAIX;QAhND;;WAEG;QACH,iBAAY,GAAY,KAAK,CAAA;QAE7B;;WAEG;QACH,mBAAc,GAAY,KAAK,CAAA;QAE/B;;;WAGG;QACH,cAAS,GAAY,KAAK,CAAA;QAE1B;;WAEG;QACH,WAAM,GAAY,KAAK,CAAA;QAEvB;;WAEG;QACH,YAAO,GAAY,KAAK,CAAA;QAExB;;;;;WAKG;QACH,uBAAkB,GAAY,IAAI,CAAA;QASlC;;WAEG;QACH,oBAAe,GAAY,KAAK,CAAA;QAEhC;;WAEG;QACH,oBAAe,GAAY,KAAK,CAAA;QAEhC;;WAEG;QACH,oBAAe,GAAY,KAAK,CAAA;QAEhC;;WAEG;QACH,wBAAmB,GAAY,KAAK,CAAA;QAEpC;;WAEG;QACH,qBAAgB,GAAY,KAAK,CAAA;QAEjC;;WAEG;QACH,eAAU,GAAY,IAAI,CAAA;QAiB1B;;;;WAIG;QACH,gCAA2B,GAAY,IAAI,CAAA;QAS3C;;WAEG;QACH,aAAQ,GAAY,KAAK,CAAA;QAEzB;;WAEG;QACH,eAAU,GAAY,KAAK,CAAA;QAE3B;;;WAGG;QACH,oBAAe,GAAY,KAAK,CAAA;QAEhC;;WAEG;QACH,qBAAgB,GAAY,KAAK,CAAA;QAEjC;;;WAGG;QACH,uBAAkB,GAAY,KAAK,CAAA;QAEnC;;WAEG;QACH,gBAAW,GAAY,KAAK,CAAA;QAE5B;;WAEG;QACH,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O,IAAI,CAAC,YAAY,CAAA;QAE5B,OAAO,CACH,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC;YACnD,GAAG;YACH,IAAI,CAAC,YAAY,CACpB,CAAA;IACL,CAAC;CACJ;AAtoBD,4CAsoBC","file":"RelationMetadata.js","sourcesContent":["import { RelationType } from \"./types/RelationTypes\"\nimport { EntityMetadata } from \"./EntityMetadata\"\nimport { ForeignKeyMetadata } from \"./ForeignKeyMetadata\"\nimport { ObjectLiteral } from \"../common/ObjectLiteral\"\nimport { ColumnMetadata } from \"./ColumnMetadata\"\nimport { EmbeddedMetadata } from \"./EmbeddedMetadata\"\nimport { RelationMetadataArgs } from \"../metadata-args/RelationMetadataArgs\"\nimport { DeferrableType } from \"./types/DeferrableType\"\nimport { OnUpdateType } from \"./types/OnUpdateType\"\nimport { OnDeleteType } from \"./types/OnDeleteType\"\nimport { PropertyTypeFactory } from \"./types/PropertyTypeInFunction\"\nimport { TypeORMError } from \"../error\"\nimport { ObjectUtils } from \"../util/ObjectUtils\"\nimport { InstanceChecker } from \"../util/InstanceChecker\"\n\n/**\n * Contains all information about some entity's relation.\n */\nexport class RelationMetadata {\n    // ---------------------------------------------------------------------\n    // Public Properties\n    // ---------------------------------------------------------------------\n\n    /**\n     * Entity metadata of the entity where this relation is placed.\n     *\n     * For example for @ManyToMany(type => Category) in Post, entityMetadata will be metadata of Post entity.\n     */\n    entityMetadata: EntityMetadata\n\n    /**\n     * Entity metadata of the entity that is targeted by this relation.\n     *\n     * For example for @ManyToMany(type => Category) in Post, inverseEntityMetadata will be metadata of Category entity.\n     */\n    inverseEntityMetadata: EntityMetadata\n\n    /**\n     * Entity metadata of the junction table.\n     * Junction tables have their own entity metadata objects.\n     * Defined only for many-to-many relations.\n     */\n    junctionEntityMetadata?: EntityMetadata\n\n    /**\n     * Embedded metadata where this relation is.\n     * If this relation is not in embed then this property value is undefined.\n     */\n    embeddedMetadata?: EmbeddedMetadata\n\n    /**\n     * Relation type, e.g. is it one-to-one, one-to-many, many-to-one or many-to-many.\n     */\n    relationType: RelationType\n\n    /**\n     * Target entity to which this relation is applied.\n     * Target IS NOT equal to entityMetadata.target, because relation\n     *\n     * For example for @ManyToMany(type => Category) in Post, target will be Post.\n     * If @ManyToMany(type => Category) is in Counters which is embedded into Post, target will be Counters.\n     * If @ManyToMany(type => Category) is in abstract class BaseUser which Post extends, target will be BaseUser.\n     * Target can be string if its defined in entity schema instead of class.\n     */\n    target: Function | string\n\n    /**\n     * Target's property name to which relation decorator is applied.\n     */\n    propertyName: string\n\n    /**\n     * Gets full path to this column property (including relation name).\n     * Full path is relevant when column is used in embeds (one or multiple nested).\n     * For example it will return \"counters.subcounters.likes\".\n     * If property is not in embeds then it returns just property name of the column.\n     */\n    propertyPath: string\n\n    /**\n     * Indicates if this is a parent (can be only many-to-one relation) relation in the tree tables.\n     */\n    isTreeParent: boolean = false\n\n    /**\n     * Indicates if this is a children (can be only one-to-many relation) relation in the tree tables.\n     */\n    isTreeChildren: boolean = false\n\n    /**\n     * Indicates if this relation's column is a primary key.\n     * Can be used only for many-to-one and owner one-to-one relations.\n     */\n    isPrimary: boolean = false\n\n    /**\n     * Indicates if this relation is lazily loaded.\n     */\n    isLazy: boolean = false\n\n    /**\n     * Indicates if this relation is eagerly loaded.\n     */\n    isEager: boolean = false\n\n    /**\n     * Indicates if persistence is enabled for the relation.\n     * By default its enabled, but if you want to avoid any changes in the relation to be reflected in the database you can disable it.\n     * If its disabled you can only change a relation from inverse side of a relation or using relation query builder functionality.\n     * This is useful for performance optimization since its disabling avoid multiple extra queries during entity save.\n     */\n    persistenceEnabled: boolean = true\n\n    /**\n     * When a parent is saved (with cascading but) without a child row that still exists in database, this will control what shall happen to them.\n     * delete will remove these rows from database. nullify will remove the relation key.\n     * skip will keep the relation intact. Removal of related item is only possible through its own repo.\n     */\n    orphanedRowAction?: \"nullify\" | \"delete\" | \"soft-delete\" | \"disable\"\n\n    /**\n     * If set to true then related objects are allowed to be inserted to the database.\n     */\n    isCascadeInsert: boolean = false\n\n    /**\n     * If set to true then related objects are allowed to be updated in the database.\n     */\n    isCascadeUpdate: boolean = false\n\n    /**\n     * If set to true then related objects are allowed to be remove from the database.\n     */\n    isCascadeRemove: boolean = false\n\n    /**\n     * If set to true then related objects are allowed to be soft-removed from the database.\n     */\n    isCascadeSoftRemove: boolean = false\n\n    /**\n     * If set to true then related objects are allowed to be recovered from the database.\n     */\n    isCascadeRecover: boolean = false\n\n    /**\n     * Indicates if relation column value can be nullable or not.\n     */\n    isNullable: boolean = true\n\n    /**\n     * What to do with a relation on deletion of the row containing a foreign key.\n     */\n    onDelete?: OnDeleteType\n\n    /**\n     * What to do with a relation on update of the row containing a foreign key.\n     */\n    onUpdate?: OnUpdateType\n\n    /**\n     * What to do with a relation on update of the row containing a foreign key.\n     */\n    deferrable?: DeferrableType\n\n    /**\n     * Indicates whether foreign key constraints will be created for join columns.\n     * Can be used only for many-to-one and owner one-to-one relations.\n     * Defaults to true.\n     */\n    createForeignKeyConstraints: boolean = true\n\n    /**\n     * Gets the property's type to which this relation is applied.\n     *\n     * For example for @ManyToMany(type => Category) in Post, target will be Category.\n     */\n    type: Function | string\n\n    /**\n     * Indicates if this side is an owner of this relation.\n     */\n    isOwning: boolean = false\n\n    /**\n     * Checks if this relation's type is \"one-to-one\".\n     */\n    isOneToOne: boolean = false\n\n    /**\n     * Checks if this relation is owner side of the \"one-to-one\" relation.\n     * Owner side means this side of relation has a join column in the table.\n     */\n    isOneToOneOwner: boolean = false\n\n    /**\n     * Checks if this relation has a join column (e.g. is it many-to-one or one-to-one owner side).\n     */\n    isWithJoinColumn: boolean = false\n\n    /**\n     * Checks if this relation is NOT owner side of the \"one-to-one\" relation.\n     * NOT owner side means this side of relation does not have a join column in the table.\n     */\n    isOneToOneNotOwner: boolean = false\n\n    /**\n     * Checks if this relation's type is \"one-to-many\".\n     */\n    isOneToMany: boolean = false\n\n    /**\n     * Checks if this relation's type is \"many-to-one\".\n     */\n    isManyToOne: boolean = false\n\n    /**\n     * Checks if this relation's type is \"many-to-many\".\n     */\n    isManyToMany: boolean = false\n\n    /**\n     * Checks if this relation's type is \"many-to-many\", and is owner side of the relationship.\n     * Owner side means this side of relation has a join table.\n     */\n    isManyToManyOwner: boolean = false\n\n    /**\n     * Checks if this relation's type is \"many-to-many\", and is NOT owner side of the relationship.\n     * Not owner side means this side of relation does not have a join table.\n     */\n    isManyToManyNotOwner: boolean = false\n\n    /**\n     * Gets the property path of the inverse side of the relation.\n     */\n    inverseSidePropertyPath: string\n\n    /**\n     * Inverse side of the relation set by user.\n     *\n     * Inverse side set in the relation can be either string - property name of the column on inverse side,\n     * either can be a function that accepts a map of properties with the object and returns one of them.\n     * Second approach is used to achieve type-safety.\n     */\n    givenInverseSidePropertyFactory: PropertyTypeFactory<any>\n\n    /**\n     * Gets the relation metadata of the inverse side of this relation.\n     */\n    inverseRelation?: RelationMetadata\n\n    /**\n     * Join table name.\n     */\n    joinTableName: string\n\n    /**\n     * Foreign keys created for this relation.\n     */\n    foreignKeys: ForeignKeyMetadata[] = []\n\n    /**\n     * Join table columns.\n     * Join columns can be obtained only from owner side of the relation.\n     * From non-owner side of the relation join columns will be empty.\n     * If this relation is a many-to-one/one-to-one then it takes join columns from the current entity.\n     * If this relation is many-to-many then it takes all owner join columns from the junction entity.\n     */\n    joinColumns: ColumnMetadata[] = []\n\n    /**\n     * Inverse join table columns.\n     * Inverse join columns are supported only for many-to-many relations\n     * and can be obtained only from owner side of the relation.\n     * From non-owner side of the relation join columns will be undefined.\n     */\n    inverseJoinColumns: ColumnMetadata[] = []\n\n    // ---------------------------------------------------------------------\n    // Constructor\n    // ---------------------------------------------------------------------\n\n    constructor(options: {\n        entityMetadata: EntityMetadata\n        embeddedMetadata?: EmbeddedMetadata\n        args: RelationMetadataArgs\n    }) {\n        this.entityMetadata = options.entityMetadata\n        this.embeddedMetadata = options.embeddedMetadata!\n        const args = options.args\n        this.target = args.target\n        this.propertyName = args.propertyName\n        this.relationType = args.relationType\n\n        if (args.inverseSideProperty)\n            this.givenInverseSidePropertyFactory = args.inverseSideProperty\n\n        this.isLazy = args.isLazy || false\n        // this.isCascadeInsert = args.options.cascade === true || (args.options.cascade instanceof Array && args.options.cascade.indexOf(\"insert\") !== -1);\n        // this.isCascadeUpdate = args.options.cascade === true || (args.options.cascade instanceof Array && args.options.cascade.indexOf(\"update\") !== -1);\n        // this.isCascadeRemove = args.options.cascade === true || (args.options.cascade instanceof Array && args.options.cascade.indexOf(\"remove\") !== -1);\n        // this.isCascadeSoftRemove = args.options.cascade === true || (args.options.cascade instanceof Array && args.options.cascade.indexOf(\"soft-remove\") !== -1);\n        // this.isCascadeRecover = args.options.cascade === true || (args.options.cascade instanceof Array && args.options.cascade.indexOf(\"recover\") !== -1);\n        this.isCascadeInsert =\n            args.options.cascade === true ||\n            (Array.isArray(args.options.cascade) &&\n                args.options.cascade.indexOf(\"insert\") !== -1)\n        this.isCascadeUpdate =\n            args.options.cascade === true ||\n            (Array.isArray(args.options.cascade) &&\n                args.options.cascade.indexOf(\"update\") !== -1)\n        this.isCascadeRemove =\n            args.options.cascade === true ||\n            (Array.isArray(args.options.cascade) &&\n                args.options.cascade.indexOf(\"remove\") !== -1)\n        this.isCascadeSoftRemove =\n            args.options.cascade === true ||\n            (Array.isArray(args.options.cascade) &&\n                args.options.cascade.indexOf(\"soft-remove\") !== -1)\n        this.isCascadeRecover =\n            args.options.cascade === true ||\n            (Array.isArray(args.options.cascade) &&\n                args.options.cascade.indexOf(\"recover\") !== -1)\n        // this.isPrimary = args.options.primary || false;\n        this.isNullable =\n            args.options.nullable === false || this.isPrimary ? false : true\n        this.onDelete = args.options.onDelete\n        this.onUpdate = args.options.onUpdate\n        this.deferrable = args.options.deferrable\n        this.createForeignKeyConstraints =\n            args.options.createForeignKeyConstraints === false ? false : true\n        this.isEager = args.options.eager || false\n        this.persistenceEnabled =\n            args.options.persistence === false ? false : true\n        this.orphanedRowAction = args.options.orphanedRowAction || \"nullify\"\n        this.isTreeParent = args.isTreeParent || false\n        this.isTreeChildren = args.isTreeChildren || false\n\n        if (typeof args.type === \"function\") {\n            this.type =\n                typeof args.type === \"function\"\n                    ? (args.type as () => any)()\n                    : args.type\n        } else if (InstanceChecker.isEntitySchema(args.type)) {\n            this.type = args.type.options.name\n        } else if (\n            ObjectUtils.isObject(args.type) &&\n            typeof (args.type as any).name === \"string\"\n        ) {\n            this.type = (args.type as any).name\n        } else {\n            this.type = args.type as string | Function\n        }\n\n        this.isOneToOne = this.relationType === \"one-to-one\"\n        this.isOneToMany = this.relationType === \"one-to-many\"\n        this.isManyToOne = this.relationType === \"many-to-one\"\n        this.isManyToMany = this.relationType === \"many-to-many\"\n        this.isOneToOneNotOwner = this.isOneToOne ? true : false\n        this.isManyToManyNotOwner = this.isManyToMany ? true : false\n    }\n\n    // ---------------------------------------------------------------------\n    // Public Methods\n    // ---------------------------------------------------------------------\n\n    /**\n     * Creates join column ids map from the given related entity ids array.\n     */\n    getRelationIdMap(entity: ObjectLiteral): ObjectLiteral | undefined {\n        const joinColumns = this.isOwning\n            ? this.joinColumns\n            : this.inverseRelation!.joinColumns\n        const referencedColumns = joinColumns.map(\n            (joinColumn) => joinColumn.referencedColumn!,\n        )\n        // console.log(\"entity\", entity);\n        // console.log(\"referencedColumns\", referencedColumns);\n        return EntityMetadata.getValueMap(entity, referencedColumns)\n    }\n\n    /**\n     * Ensures that given object is an entity id map.\n     * If given id is an object then it means its already id map.\n     * If given id isn't an object then it means its a value of the id column\n     * and it creates a new id map with this value and name of the primary column.\n     */\n    ensureRelationIdMap(id: any): ObjectLiteral {\n        if (ObjectUtils.isObject(id)) return id\n\n        const joinColumns = this.isOwning\n            ? this.joinColumns\n            : this.inverseRelation!.joinColumns\n        const referencedColumns = joinColumns.map(\n            (joinColumn) => joinColumn.referencedColumn!,\n        )\n\n        if (referencedColumns.length > 1)\n            throw new TypeORMError(\n                `Cannot create relation id map for a single value because relation contains multiple referenced columns.`,\n            )\n\n        return referencedColumns[0].createValueMap(id)\n    }\n\n    /**\n     * Extracts column value from the given entity.\n     * If column is in embedded (or recursive embedded) it extracts its value from there.\n     */\n    getEntityValue(\n        entity: ObjectLiteral,\n        getLazyRelationsPromiseValue: boolean = false,\n    ): any | undefined {\n        if (entity === null || entity === undefined) return undefined\n        // extract column value from embeddeds of entity if column is in embedded\n        if (this.embeddedMetadata) {\n            // example: post[data][information][counters].id where \"data\", \"information\" and \"counters\" are embeddeds\n            // we need to get value of \"id\" column from the post real entity object\n\n            // first step - we extract all parent properties of the entity relative to this column, e.g. [data, information, counters]\n            const propertyNames = [...this.embeddedMetadata.parentPropertyNames]\n\n            // next we need to access post[data][information][counters][this.propertyName] to get column value from the counters\n            // this recursive function takes array of generated property names and gets the post[data][information][counters] embed\n            const extractEmbeddedColumnValue = (\n                propertyNames: string[],\n                value: ObjectLiteral,\n            ): any => {\n                const propertyName = propertyNames.shift()\n                if (propertyName) {\n                    if (value[propertyName]) {\n                        return extractEmbeddedColumnValue(\n                            propertyNames,\n                            value[propertyName],\n                        )\n                    }\n                    return undefined\n                }\n                return value\n            }\n\n            // once we get nested embed object we get its column, e.g. post[data][information][counters][this.propertyName]\n            const embeddedObject = extractEmbeddedColumnValue(\n                propertyNames,\n                entity,\n            )\n\n            if (this.isLazy) {\n                if (\n                    embeddedObject[\"__\" + this.propertyName + \"__\"] !==\n                    undefined\n                )\n                    return embeddedObject[\"__\" + this.propertyName + \"__\"]\n\n                if (getLazyRelationsPromiseValue === true)\n                    return embeddedObject[this.propertyName]\n\n                return undefined\n            }\n            return embeddedObject\n                ? embeddedObject[\n                      this.isLazy\n                          ? \"__\" + this.propertyName + \"__\"\n                          : this.propertyName\n                  ]\n                : undefined\n        } else {\n            // no embeds - no problems. Simply return column name by property name of the entity\n            if (this.isLazy) {\n                if (entity[\"__\" + this.propertyName + \"__\"] !== undefined)\n                    return entity[\"__\" + this.propertyName + \"__\"]\n\n                if (getLazyRelationsPromiseValue === true)\n                    return entity[this.propertyName]\n\n                return undefined\n            }\n            return entity[this.propertyName]\n        }\n    }\n\n    /**\n     * Sets given entity's relation's value.\n     * Using of this method helps to set entity relation's value of the lazy and non-lazy relations.\n     *\n     * If merge is set to true, it merges given value into currently\n     */\n    setEntityValue(entity: ObjectLiteral, value: any): void {\n        const propertyName = this.isLazy\n            ? \"__\" + this.propertyName + \"__\"\n            : this.propertyName\n\n        if (this.embeddedMetadata) {\n            // first step - we extract all parent properties of the entity relative to this column, e.g. [data, information, counters]\n            const extractEmbeddedColumnValue = (\n                embeddedMetadatas: EmbeddedMetadata[],\n                map: ObjectLiteral,\n            ): any => {\n                // if (!object[embeddedMetadata.propertyName])\n                //     object[embeddedMetadata.propertyName] = embeddedMetadata.create();\n\n                const embeddedMetadata = embeddedMetadatas.shift()\n                if (embeddedMetadata) {\n                    if (!map[embeddedMetadata.propertyName])\n                        map[embeddedMetadata.propertyName] =\n                            embeddedMetadata.create()\n\n                    extractEmbeddedColumnValue(\n                        embeddedMetadatas,\n                        map[embeddedMetadata.propertyName],\n                    )\n                    return map\n                }\n                map[propertyName] = value\n                return map\n            }\n            return extractEmbeddedColumnValue(\n                [...this.embeddedMetadata.embeddedMetadataTree],\n                entity,\n            )\n        } else {\n            entity[propertyName] = value\n        }\n    }\n\n    /**\n     * Creates entity id map from the given entity ids array.\n     */\n    createValueMap(value: any) {\n        // extract column value from embeds of entity if column is in embedded\n        if (this.embeddedMetadata) {\n            // example: post[data][information][counters].id where \"data\", \"information\" and \"counters\" are embeddeds\n            // we need to get value of \"id\" column from the post real entity object and return it in a\n            // { data: { information: { counters: { id: ... } } } } format\n\n            // first step - we extract all parent properties of the entity relative to this column, e.g. [data, information, counters]\n            const propertyNames = [...this.embeddedMetadata.parentPropertyNames]\n\n            // now need to access post[data][information][counters] to get column value from the counters\n            // and on each step we need to create complex literal object, e.g. first { data },\n            // then { data: { information } }, then { data: { information: { counters } } },\n            // then { data: { information: { counters: [this.propertyName]: entity[data][information][counters][this.propertyName] } } }\n            // this recursive function helps doing that\n            const extractEmbeddedColumnValue = (\n                propertyNames: string[],\n                map: ObjectLiteral,\n            ): any => {\n                const propertyName = propertyNames.shift()\n                if (propertyName) {\n                    map[propertyName] = {}\n                    extractEmbeddedColumnValue(propertyNames, map[propertyName])\n                    return map\n                }\n                map[this.propertyName] = value\n                return map\n            }\n            return extractEmbeddedColumnValue(propertyNames, {})\n        } else {\n            // no embeds - no problems. Simply return column property name and its value of the entity\n            return { [this.propertyName]: value }\n        }\n    }\n\n    // ---------------------------------------------------------------------\n    // Builder Methods\n    // ---------------------------------------------------------------------\n\n    /**\n     * Builds some depend relation metadata properties.\n     * This builder method should be used only after embedded metadata tree was build.\n     */\n    build() {\n        this.propertyPath = this.buildPropertyPath()\n    }\n\n    /**\n     * Registers given foreign keys in the relation.\n     * This builder method should be used to register foreign key in the relation.\n     */\n    registerForeignKeys(...foreignKeys: ForeignKeyMetadata[]) {\n        this.foreignKeys.push(...foreignKeys)\n    }\n\n    /**\n     * Registers given join columns in the relation.\n     * This builder method should be used to register join column in the relation.\n     */\n    registerJoinColumns(\n        joinColumns: ColumnMetadata[] = [],\n        inverseJoinColumns: ColumnMetadata[] = [],\n    ) {\n        this.joinColumns = joinColumns\n        this.inverseJoinColumns = inverseJoinColumns\n        this.isOwning =\n            this.isManyToOne ||\n            ((this.isManyToMany || this.isOneToOne) &&\n                this.joinColumns.length > 0)\n        this.isOneToOneOwner = this.isOneToOne && this.isOwning\n        this.isOneToOneNotOwner = this.isOneToOne && !this.isOwning\n        this.isManyToManyOwner = this.isManyToMany && this.isOwning\n        this.isManyToManyNotOwner = this.isManyToMany && !this.isOwning\n        this.isWithJoinColumn = this.isManyToOne || this.isOneToOneOwner\n    }\n\n    /**\n     * Registers a given junction entity metadata.\n     * This builder method can be called after junction entity metadata for the many-to-many relation was created.\n     */\n    registerJunctionEntityMetadata(junctionEntityMetadata: EntityMetadata) {\n        this.junctionEntityMetadata = junctionEntityMetadata\n        this.joinTableName = junctionEntityMetadata.tableName\n        if (this.inverseRelation) {\n            this.inverseRelation.junctionEntityMetadata = junctionEntityMetadata\n            this.joinTableName = junctionEntityMetadata.tableName\n        }\n    }\n\n    /**\n     * Builds inverse side property path based on given inverse side property factory.\n     * This builder method should be used only after properties map of the inverse entity metadata was build.\n     */\n    buildInverseSidePropertyPath(): string {\n        if (this.givenInverseSidePropertyFactory) {\n            const ownerEntityPropertiesMap =\n                this.inverseEntityMetadata.propertiesMap\n            if (typeof this.givenInverseSidePropertyFactory === \"function\")\n                return this.givenInverseSidePropertyFactory(\n                    ownerEntityPropertiesMap,\n                )\n\n            if (typeof this.givenInverseSidePropertyFactory === \"string\")\n                return this.givenInverseSidePropertyFactory\n        } else if (\n            this.isTreeParent &&\n            this.entityMetadata.treeChildrenRelation\n        ) {\n            return this.entityMetadata.treeChildrenRelation.propertyName\n        } else if (\n            this.isTreeChildren &&\n            this.entityMetadata.treeParentRelation\n        ) {\n            return this.entityMetadata.treeParentRelation.propertyName\n        }\n\n        return \"\"\n    }\n\n    /**\n     * Builds relation's property path based on its embedded tree.\n     */\n    buildPropertyPath(): string {\n        if (\n            !this.embeddedMetadata ||\n            !this.embeddedMetadata.parentPropertyNames.length\n        )\n            return this.propertyName\n\n        return (\n            this.embeddedMetadata.parentPropertyNames.join(\".\") +\n            \".\" +\n            this.propertyName\n        )\n    }\n}\n"],"sourceRoot":".."}