require('reflect-metadata/reflect'); import * as models from './models/testModels'; import {Decorators} from '../core/constants'; import {DecoratorType} from '../core/enums'; import {Strict} from '../mongoose/enums'; import {MetaUtils} from "../core/metadata/utils"; export function initializeModels1() { var obj1 = new models.student(); var obj2 = new models.subject(); var obj3 = new models.teacher(); var obj4 = new models.division(); } export function initializeModels() { //MetaUtils.addMetaData(models.student.prototype, Decorators.DOCUMENT, DecoratorType.CLASS, { name: models.student.name, strict: Strict.true }); //MetaUtils.addMetaData(models.student.prototype, Decorators.FIELD, DecoratorType.PROPERTY, { primary: true, autogenerated: true }, '_id'); //MetaUtils.addMetaData(models.student.prototype, Decorators.FIELD, DecoratorType.PROPERTY, null, 'name'); //MetaUtils.addMetaData(models.student.prototype, Decorators.ONETOMANY, DecoratorType.PROPERTY, { rel: models.subject.name, itemType: models.subject, embedded: true }, 'subjects'); //MetaUtils.addMetaData(models.student.prototype, Decorators.FIELD, DecoratorType.PROPERTY, null, 'addresses'); //MetaUtils.addMetaData(models.subject, Decorators.DOCUMENT, DecoratorType.CLASS, { name: models.subject.name, strict: Strict.true }); //MetaUtils.addMetaData(models.subject, Decorators.FIELD, DecoratorType.PROPERTY, { primary: true, autogenerated: true }, '_id'); //MetaUtils.addMetaData(models.subject, Decorators.FIELD, DecoratorType.PROPERTY, null, 'name'); //MetaUtils.addMetaData(models.teacher, Decorators.DOCUMENT, DecoratorType.CLASS, { name: models.teacher.name, strict: Strict.true }); //MetaUtils.addMetaData(models.teacher, Decorators.FIELD, DecoratorType.PROPERTY, { primary: true, autogenerated: true }, '_id'); //MetaUtils.addMetaData(models.teacher, Decorators.FIELD, DecoratorType.PROPERTY, null, 'name'); //MetaUtils.addMetaData(models.division, Decorators.DOCUMENT, DecoratorType.CLASS, { name: models.division.name, strict: Strict.true }); //MetaUtils.addMetaData(models.division, Decorators.FIELD, DecoratorType.PROPERTY, { primary: true, autogenerated: true }, '_id'); //MetaUtils.addMetaData(models.division, Decorators.FIELD, DecoratorType.PROPERTY, null, 'name'); //MetaUtils.addMetaData(models.division, Decorators.ONETOMANY, DecoratorType.PROPERTY, { rel: models.student.name, itemType: models.student, embedded: true }, 'students'); };