UNPKG

1.41 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3/**
4 * Exclusion metadata contains all information about table's exclusion constraints.
5 */
6var ExclusionMetadata = /** @class */ (function () {
7 // ---------------------------------------------------------------------
8 // Constructor
9 // ---------------------------------------------------------------------
10 function ExclusionMetadata(options) {
11 this.entityMetadata = options.entityMetadata;
12 if (options.args) {
13 this.target = options.args.target;
14 this.expression = options.args.expression;
15 this.givenName = options.args.name;
16 }
17 }
18 // ---------------------------------------------------------------------
19 // Public Build Methods
20 // ---------------------------------------------------------------------
21 /**
22 * Builds some depend exclusion constraint properties.
23 * Must be called after all entity metadata's properties map, columns and relations are built.
24 */
25 ExclusionMetadata.prototype.build = function (namingStrategy) {
26 this.name = this.givenName ? this.givenName : namingStrategy.exclusionConstraintName(this.entityMetadata.tablePath, this.expression);
27 return this;
28 };
29 return ExclusionMetadata;
30}());
31exports.ExclusionMetadata = ExclusionMetadata;
32
33//# sourceMappingURL=ExclusionMetadata.js.map