typeorm
Version:
Data-Mapper ORM for TypeScript, ES7, ES6, ES5. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, MongoDB databases.
40 lines (38 loc) • 1.11 kB
JavaScript
import { ObjectUtils } from "../util/ObjectUtils";
import { TypeORMError } from "../error";
/**
*/
var Alias = /** @class */ (function () {
function Alias(alias) {
ObjectUtils.assign(this, alias || {});
}
Object.defineProperty(Alias.prototype, "target", {
get: function () {
return this.metadata.target;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Alias.prototype, "hasMetadata", {
get: function () {
return !!this._metadata;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Alias.prototype, "metadata", {
get: function () {
if (!this._metadata)
throw new TypeORMError("Cannot get entity metadata for the given alias \"" + this.name + "\"");
return this._metadata;
},
set: function (metadata) {
this._metadata = metadata;
},
enumerable: false,
configurable: true
});
return Alias;
}());
export { Alias };
//# sourceMappingURL=Alias.js.map