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A1qBA,AA0qBC,IAAA;AA1qBY,wCAAc","file":"ColumnMetadata.js","sourcesContent":["import {ColumnType} from \"../driver/types/ColumnTypes\";\nimport {EntityMetadata} from \"./EntityMetadata\";\nimport {EmbeddedMetadata} from \"./EmbeddedMetadata\";\nimport {RelationMetadata} from \"./RelationMetadata\";\nimport {ObjectLiteral} from \"../common/ObjectLiteral\";\nimport {ColumnMetadataArgs} from \"../metadata-args/ColumnMetadataArgs\";\nimport {Connection} from \"../connection/Connection\";\nimport {OrmUtils} from \"../util/OrmUtils\";\nimport {ValueTransformer} from \"../decorator/options/ValueTransformer\";\nimport {MongoDriver} from \"../driver/mongodb/MongoDriver\";\nimport {PromiseUtils} from \"../util/PromiseUtils\";\nimport {FindOperator} from \"../find-options/FindOperator\";\nimport {ApplyValueTransformers} from \"../util/ApplyValueTransformers\";\n\n/**\n * This metadata contains all information about entity's column.\n */\nexport class ColumnMetadata {\n\n // ---------------------------------------------------------------------\n // Public Properties\n // ---------------------------------------------------------------------\n\n /**\n * Target class where column decorator is used.\n * This may not be always equal to entity metadata (for example embeds or inheritance cases).\n */\n target: Function|string;\n\n /**\n * Entity metadata where this column metadata is.\n *\n * For example for @Column() name: string in Post, entityMetadata will be metadata of Post entity.\n */\n entityMetadata: EntityMetadata;\n\n /**\n * Embedded metadata where this column metadata is.\n * If this column is not in embed then this property value is undefined.\n */\n embeddedMetadata?: EmbeddedMetadata;\n\n /**\n * If column is a foreign key of some relation then this relation's metadata will be there.\n * If this column does not have a foreign key then this property value is undefined.\n */\n relationMetadata?: RelationMetadata;\n\n /**\n * Class's property name on which this column is applied.\n */\n propertyName: string;\n\n /**\n * The database type of the column.\n */\n type: ColumnType;\n\n /**\n * Type's length in the database.\n */\n length: string = \"\";\n\n /**\n * Type's display width in the database.\n */\n width?: number;\n\n /**\n * Defines column character set.\n */\n charset?: string;\n\n /**\n * Defines column collation.\n */\n collation?: string;\n\n /**\n * Indicates if this column is a primary key.\n */\n isPrimary: boolean = false;\n\n /**\n * Indicates if this column is generated (auto increment or generated other way).\n */\n isGenerated: boolean = false;\n\n /**\n * Indicates if column can contain nulls or not.\n */\n isNullable: boolean = false;\n\n /**\n * Indicates if column is selected by query builder or not.\n */\n isSelect: boolean = true;\n\n /**\n * Indicates if column is inserted by default or not.\n */\n isInsert: boolean = true;\n\n /**\n * Indicates if column allows updates or not.\n */\n isUpdate: boolean = true;\n\n /**\n * Specifies generation strategy if this column will use auto increment.\n */\n generationStrategy?: \"uuid\"|\"increment\"|\"rowid\";\n\n /**\n * Column comment.\n * This feature is not supported by all databases.\n */\n comment: string = \"\";\n\n /**\n * Default database value.\n */\n default?: any;\n\n /**\n * ON UPDATE trigger. Works only for MySQL.\n */\n onUpdate?: string;\n\n /**\n * The precision for a decimal (exact numeric) column (applies only for decimal column),\n * which is the maximum number of digits that are stored for the values.\n */\n precision?: number|null;\n\n /**\n * The scale for a decimal (exact numeric) column (applies only for decimal column),\n * which represents the number of digits to the right of the decimal point and must not be greater than precision.\n */\n scale?: number;\n\n /**\n * Puts ZEROFILL attribute on to numeric column. Works only for MySQL.\n * If you specify ZEROFILL for a numeric column, MySQL automatically adds the UNSIGNED attribute to the column\n */\n zerofill: boolean = false;\n\n /**\n * Puts UNSIGNED attribute on to numeric column. Works only for MySQL.\n */\n unsigned: boolean = false;\n\n /**\n * Array of possible enumerated values.\n *\n * `postgres` and `mysql` store enum values as strings but we want to keep support\n * for numeric and heterogeneous based typescript enums, so we need (string|number)[]\n */\n enum?: (string|number)[];\n\n /**\n * Generated column expression. Supports only in MySQL.\n */\n asExpression?: string;\n\n /**\n * Generated column type. Supports only in MySQL.\n */\n generatedType?: \"VIRTUAL\"|\"STORED\";\n\n /**\n * Return type of HSTORE column.\n * Returns value as string or as object.\n */\n hstoreType?: \"object\"|\"string\";\n\n /**\n * Indicates if this column is an array.\n */\n isArray: boolean = false;\n\n /**\n * Gets full path to this column property (including column property 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 * Same as property path, but dots are replaced with '_'.\n * Used in query builder statements.\n */\n propertyAliasName: string;\n\n /**\n * Gets full path to this column database name (including column database 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 database name of the column.\n */\n databasePath: string;\n\n /**\n * Complete column name in the database including its embedded prefixes.\n */\n databaseName: string;\n\n /**\n * Database name in the database without embedded prefixes applied.\n */\n databaseNameWithoutPrefixes: string;\n\n /**\n * Database name set by entity metadata builder, not yet passed naming strategy process and without embedded prefixes.\n */\n givenDatabaseName?: string;\n\n /**\n * Indicates if column is virtual. Virtual columns are not mapped to the entity.\n */\n isVirtual: boolean = false;\n\n /**\n * Indicates if column is discriminator. Discriminator columns are not mapped to the entity.\n */\n isDiscriminator: boolean = false;\n\n /**\n * Indicates if column is tree-level column. Tree-level columns are used in closure entities.\n */\n isTreeLevel: boolean = false;\n\n /**\n * Indicates if this column contains an entity creation date.\n */\n isCreateDate: boolean = false;\n\n /**\n * Indicates if this column contains an entity update date.\n */\n isUpdateDate: boolean = false;\n\n /**\n * Indicates if this column contains an entity version.\n */\n isVersion: boolean = false;\n\n /**\n * Indicates if this column contains an object id.\n */\n isObjectId: boolean = false;\n\n /**\n * If this column is foreign key then it references some other column,\n * and this property will contain reference to this column.\n */\n referencedColumn: ColumnMetadata|undefined;\n\n /**\n * Specifies a value transformer that is to be used to (un)marshal\n * this column when reading or writing to the database.\n */\n transformer?: ValueTransformer|ValueTransformer[];\n\n /**\n * Column type in the case if this column is in the closure table.\n * Column can be ancestor or descendant in the closure tables.\n */\n closureType?: \"ancestor\"|\"descendant\";\n\n /**\n * Indicates if this column is nested set's left column.\n * Used only in tree entities with nested-set type.\n */\n isNestedSetLeft: boolean = false;\n\n /**\n * Indicates if this column is nested set's right column.\n * Used only in tree entities with nested-set type.\n */\n isNestedSetRight: boolean = false;\n\n /**\n * Indicates if this column is materialized path's path column.\n * Used only in tree entities with materialized path type.\n */\n isMaterializedPath: boolean = false;\n\n /**\n * Spatial Feature Type (Geometry, Point, Polygon, etc.)\n */\n spatialFeatureType?: string;\n\n /**\n * SRID (Spatial Reference ID (EPSG code))\n */\n srid?: number;\n\n // ---------------------------------------------------------------------\n // Constructor\n // ---------------------------------------------------------------------\n\n constructor(options: {\n connection: Connection,\n entityMetadata: EntityMetadata,\n embeddedMetadata?: EmbeddedMetadata,\n referencedColumn?: ColumnMetadata,\n args: ColumnMetadataArgs,\n closureType?: \"ancestor\"|\"descendant\",\n nestedSetLeft?: boolean,\n nestedSetRight?: boolean,\n materializedPath?: boolean,\n }) {\n this.entityMetadata = options.entityMetadata;\n this.embeddedMetadata = options.embeddedMetadata!;\n this.referencedColumn = options.referencedColumn;\n if (options.args.target)\n this.target = options.args.target;\n if (options.args.propertyName)\n this.propertyName = options.args.propertyName;\n if (options.args.options.name)\n this.givenDatabaseName = options.args.options.name;\n if (options.args.options.type)\n this.type = options.args.options.type;\n if (options.args.options.length)\n this.length = options.args.options.length ? options.args.options.length.toString() : \"\";\n if (options.args.options.width)\n this.width = options.args.options.width;\n if (options.args.options.charset)\n this.charset = options.args.options.charset;\n if (options.args.options.collation)\n this.collation = options.args.options.collation;\n if (options.args.options.primary)\n this.isPrimary = options.args.options.primary;\n if (options.args.options.default === null) // to make sure default: null is the same as nullable: true\n this.isNullable = true;\n if (options.args.options.nullable !== undefined)\n this.isNullable = options.args.options.nullable;\n if (options.args.options.select !== undefined)\n this.isSelect = options.args.options.select;\n if (options.args.options.insert !== undefined)\n this.isInsert = options.args.options.insert;\n if (options.args.options.update !== undefined)\n this.isUpdate = options.args.options.update;\n if (options.args.options.readonly !== undefined)\n this.isUpdate = !options.args.options.readonly;\n if (options.args.options.comment)\n this.comment = options.args.options.comment;\n if (options.args.options.default !== undefined)\n this.default = options.args.options.default;\n if (options.args.options.onUpdate)\n this.onUpdate = options.args.options.onUpdate;\n if (options.args.options.scale !== null && options.args.options.scale !== undefined)\n this.scale = options.args.options.scale;\n if (options.args.options.zerofill) {\n this.zerofill = options.args.options.zerofill;\n this.unsigned = true; // if you specify ZEROFILL for a numeric column, MySQL automatically adds the UNSIGNED attribute to the column\n }\n if (options.args.options.unsigned)\n this.unsigned = options.args.options.unsigned;\n if (options.args.options.precision !== undefined)\n this.precision = options.args.options.precision;\n if (options.args.options.enum) {\n if (options.args.options.enum instanceof Object && !Array.isArray(options.args.options.enum)) {\n this.enum = Object.keys(options.args.options.enum)\n .filter(key => isNaN(+key)) // remove numeric keys - typescript numeric enum types generate them\n .map(key => (options.args.options.enum as ObjectLiteral)[key]);\n\n } else {\n this.enum = options.args.options.enum;\n }\n }\n if (options.args.options.asExpression) {\n this.asExpression = options.args.options.asExpression;\n this.generatedType = options.args.options.generatedType ? options.args.options.generatedType : \"VIRTUAL\";\n }\n if (options.args.options.hstoreType)\n this.hstoreType = options.args.options.hstoreType;\n if (options.args.options.array)\n this.isArray = options.args.options.array;\n if (options.args.mode) {\n this.isVirtual = options.args.mode === \"virtual\";\n this.isTreeLevel = options.args.mode === \"treeLevel\";\n this.isCreateDate = options.args.mode === \"createDate\";\n this.isUpdateDate = options.args.mode === \"updateDate\";\n this.isVersion = options.args.mode === \"version\";\n this.isObjectId = options.args.mode === \"objectId\";\n }\n if (options.args.options.transformer)\n this.transformer = options.args.options.transformer;\n if (options.args.options.spatialFeatureType)\n this.spatialFeatureType = options.args.options.spatialFeatureType;\n if (options.args.options.srid)\n this.srid = options.args.options.srid;\n if (this.isTreeLevel)\n this.type = options.connection.driver.mappedDataTypes.treeLevel;\n if (this.isCreateDate) {\n if (!this.type)\n this.type = options.connection.driver.mappedDataTypes.createDate;\n if (!this.default)\n this.default = () => options.connection.driver.mappedDataTypes.createDateDefault;\n if (this.precision === undefined && options.connection.driver.mappedDataTypes.createDatePrecision)\n this.precision = options.connection.driver.mappedDataTypes.createDatePrecision;\n }\n if (this.isUpdateDate) {\n if (!this.type)\n this.type = options.connection.driver.mappedDataTypes.updateDate;\n if (!this.default)\n this.default = () => options.connection.driver.mappedDataTypes.updateDateDefault;\n if (this.precision === undefined && options.connection.driver.mappedDataTypes.updateDatePrecision)\n this.precision = options.connection.driver.mappedDataTypes.updateDatePrecision;\n }\n if (this.isVersion)\n this.type = options.connection.driver.mappedDataTypes.version;\n if (options.closureType)\n this.closureType = options.closureType;\n if (options.nestedSetLeft)\n this.isNestedSetLeft = options.nestedSetLeft;\n if (options.nestedSetRight)\n this.isNestedSetRight = options.nestedSetRight;\n if (options.materializedPath)\n this.isMaterializedPath = options.materializedPath;\n }\n\n // ---------------------------------------------------------------------\n // Public Methods\n // ---------------------------------------------------------------------\n\n /**\n * Creates entity id map from the given entity ids array.\n */\n createValueMap(value: any, useDatabaseName = false) {\n\n // extract column value from embeds of entity if column is in embedded\n if (this.embeddedMetadata) {\n\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 = (propertyNames: string[], map: ObjectLiteral): any => {\n const propertyName = propertyNames.shift();\n if (propertyName) {\n map[propertyName] = {};\n extractEmbeddedColumnValue(propertyNames, map[propertyName]);\n return map;\n }\n\n // this is bugfix for #720 when increment number is bigint we need to make sure its a string\n if ((this.generationStrategy === \"increment\" || this.generationStrategy === \"rowid\") && this.type === \"bigint\")\n value = String(value);\n\n map[useDatabaseName ? this.databaseName : this.propertyName] = value;\n return map;\n };\n return extractEmbeddedColumnValue(propertyNames, {});\n\n } else { // no embeds - no problems. Simply return column property name and its value of the entity\n\n // this is bugfix for #720 when increment number is bigint we need to make sure its a string\n if ((this.generationStrategy === \"increment\" || this.generationStrategy === \"rowid\") && this.type === \"bigint\")\n value = String(value);\n\n return { [useDatabaseName ? this.databaseName : this.propertyName]: value };\n }\n }\n\n /**\n * Extracts column value and returns its column name with this value in a literal object.\n * If column is in embedded (or recursive embedded) it returns complex literal object.\n *\n * Examples what this method can return depend if this column is in embeds.\n * { id: 1 } or { title: \"hello\" }, { counters: { code: 1 } }, { data: { information: { counters: { code: 1 } } } }\n */\n getEntityValueMap(entity: ObjectLiteral, options?: { skipNulls?: boolean }): ObjectLiteral|undefined {\n const returnNulls = false; // options && options.skipNulls === false ? false : true; // todo: remove if current will not bring problems, uncomment if it will.\n\n // extract column value from embeds of entity if column is in embedded\n if (this.embeddedMetadata) {\n\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 = (propertyNames: string[], value: ObjectLiteral, map: ObjectLiteral): any => {\n const propertyName = propertyNames.shift();\n if (value === undefined)\n return map;\n\n if (propertyName) {\n const submap: ObjectLiteral = {};\n extractEmbeddedColumnValue(propertyNames, value[propertyName], submap);\n if (Object.keys(submap).length > 0) {\n map[propertyName] = submap;\n }\n return map;\n }\n if (value[this.propertyName] !== undefined && (returnNulls === false || value[this.propertyName] !== null))\n map[this.propertyName] = value[this.propertyName];\n return map;\n };\n const map: ObjectLiteral = {};\n extractEmbeddedColumnValue(propertyNames, entity, map);\n return Object.keys(map).length > 0 ? map : undefined;\n\n } else { // no embeds - no problems. Simply return column property name and its value of the entity\n if (this.relationMetadata && entity[this.propertyName] && entity[this.propertyName] instanceof Object) {\n const map = this.relationMetadata.joinColumns.reduce((map, joinColumn) => {\n const value = joinColumn.referencedColumn!.getEntityValueMap(entity[this.propertyName]);\n if (value === undefined) return map;\n return OrmUtils.mergeDeep(map, value);\n }, {});\n if (Object.keys(map).length > 0)\n return { [this.propertyName]: map };\n\n return undefined;\n } else {\n if (entity[this.propertyName] !== undefined && (returnNulls === false || entity[this.propertyName] !== null))\n return { [this.propertyName]: entity[this.propertyName] };\n\n return undefined;\n }\n }\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(entity: ObjectLiteral, transform: boolean = false): any|undefined {\n if (entity === undefined || entity === null) return undefined;\n\n // extract column value from embeddeds of entity if column is in embedded\n let value: any = undefined;\n if (this.embeddedMetadata) {\n\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 = (propertyNames: string[], value: ObjectLiteral): any => {\n const propertyName = propertyNames.shift();\n return propertyName && value ? extractEmbeddedColumnValue(propertyNames, value[propertyName]) : 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(propertyNames, entity);\n if (embeddedObject) {\n if (this.relationMetadata && this.referencedColumn) {\n const relatedEntity = this.relationMetadata.getEntityValue(embeddedObject);\n if (relatedEntity && relatedEntity instanceof Object && !(relatedEntity instanceof FindOperator)) {\n value = this.referencedColumn.getEntityValue(PromiseUtils.extractValue(relatedEntity));\n\n } else if (embeddedObject[this.propertyName] && embeddedObject[this.propertyName] instanceof Object && !(embeddedObject[this.propertyName] instanceof FindOperator)) {\n value = this.referencedColumn.getEntityValue(PromiseUtils.extractValue(embeddedObject[this.propertyName]));\n\n } else {\n value = PromiseUtils.extractValue(embeddedObject[this.propertyName]);\n\n }\n\n } else if (this.referencedColumn) {\n value = this.referencedColumn.getEntityValue(PromiseUtils.extractValue(embeddedObject[this.propertyName]));\n\n } else {\n value = PromiseUtils.extractValue(embeddedObject[this.propertyName]);\n }\n }\n\n } else { // no embeds - no problems. Simply return column name by property name of the entity\n if (this.relationMetadata && this.referencedColumn) {\n const relatedEntity = this.relationMetadata.getEntityValue(entity);\n if (relatedEntity && relatedEntity instanceof Object && !(relatedEntity instanceof FindOperator) && !(relatedEntity instanceof Function)) {\n value = this.referencedColumn.getEntityValue(PromiseUtils.extractValue(relatedEntity));\n\n } else if (entity[this.propertyName] && entity[this.propertyName] instanceof Object && !(entity[this.propertyName] instanceof FindOperator) && !(entity[this.propertyName] instanceof Function)) {\n value = this.referencedColumn.getEntityValue(PromiseUtils.extractValue(entity[this.propertyName]));\n\n } else {\n value = entity[this.propertyName];\n }\n\n } else if (this.referencedColumn) {\n value = this.referencedColumn.getEntityValue(PromiseUtils.extractValue(entity[this.propertyName]));\n\n } else {\n value = entity[this.propertyName];\n }\n }\n\n if (transform && this.transformer)\n value = ApplyValueTransformers.transformTo(this.transformer, value);\n\n return value;\n }\n\n /**\n * Sets given entity's column value.\n * Using of this method helps to set entity relation's value of the lazy and non-lazy relations.\n */\n setEntityValue(entity: ObjectLiteral, value: any): void {\n if (this.embeddedMetadata) {\n\n // first step - we extract all parent properties of the entity relative to this column, e.g. [data, information, counters]\n const extractEmbeddedColumnValue = (embeddedMetadatas: EmbeddedMetadata[], map: ObjectLiteral): 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] = embeddedMetadata.create();\n\n extractEmbeddedColumnValue(embeddedMetadatas, map[embeddedMetadata.propertyName]);\n return map;\n }\n map[this.propertyName] = value;\n return map;\n };\n return extractEmbeddedColumnValue([...this.embeddedMetadata.embeddedMetadataTree], entity);\n\n } else {\n entity[this.propertyName] = value;\n }\n }\n\n // ---------------------------------------------------------------------\n // Builder Methods\n // ---------------------------------------------------------------------\n\n build(connection: Connection): this {\n this.propertyPath = this.buildPropertyPath();\n this.propertyAliasName = this.propertyPath.replace(\".\", \"_\");\n this.databaseName = this.buildDatabaseName(connection);\n this.databasePath = this.buildDatabasePath();\n this.databaseNameWithoutPrefixes = connection.namingStrategy.columnName(this.propertyName, this.givenDatabaseName, []);\n return this;\n }\n\n protected buildPropertyPath(): string {\n let path = \"\";\n if (this.embeddedMetadata && this.embeddedMetadata.parentPropertyNames.length)\n path = this.embeddedMetadata.parentPropertyNames.join(\".\") + \".\";\n\n path += this.propertyName;\n\n // we add reference column to property path only if this column is virtual\n // because if its not virtual it means user defined a real column for this relation\n // also we don't do it if column is inside a junction table\n if (!this.entityMetadata.isJunction && this.isVirtual && this.referencedColumn && this.referencedColumn.propertyName !== this.propertyName)\n path += \".\" + this.referencedColumn.propertyName;\n\n return path;\n }\n\n protected buildDatabasePath(): string {\n let path = \"\";\n if (this.embeddedMetadata && this.embeddedMetadata.parentPropertyNames.length)\n path = this.embeddedMetadata.parentPropertyNames.join(\".\") + \".\";\n\n path += this.databaseName;\n\n // we add reference column to property path only if this column is virtual\n // because if its not virtual it means user defined a real column for this relation\n // also we don't do it if column is inside a junction table\n if (!this.entityMetadata.isJunction && this.isVirtual && this.referencedColumn && this.referencedColumn.databaseName !== this.databaseName)\n path += \".\" + this.referencedColumn.databaseName;\n\n return path;\n }\n\n protected buildDatabaseName(connection: Connection): string {\n let propertyNames = this.embeddedMetadata ? this.embeddedMetadata.parentPrefixes : [];\n if (connection.driver instanceof MongoDriver) // we don't need to include embedded name for the mongodb column names\n propertyNames = [];\n return connection.namingStrategy.columnName(this.propertyName, this.givenDatabaseName, propertyNames);\n }\n\n}\n"],"sourceRoot":".."}
\No newline at end of file