src/Metadata/EntityMetadataBuilder.js
/**
     * Creates from the given embedded metadata args real embedded metadatas with its columns and relations,
     * and does the same for all its sub-embeddeds (goes recursively).
     */
Creates from the given embedded metadata args real embedded metadatas with its columns and relations,
and does the same for all its sub-embeddeds (goes recursively).
Creates from the given embedded metadata args real embedded metadatas with its columns and relations and does the same for all its sub - embeddeds ( goes recursively ) .
createEmbeddedsRecursively(entityMetadata, embeddedArgs) {
        return embeddedArgs.map(embeddedArgs => {
            const embeddedMetadata = new EmbeddedMetadata({ entityMetadata: entityMetadata, args: embeddedArgs });
            const targets = MetadataUtils.getInheritanceTree(embeddedMetadata.type);
            embeddedMetadata.columns = this._metadataArgsStorage.filterColumns(targets).map(args => {
                return new ColumnMetadata({ connection: this._connection, entityMetadata, embeddedMetadata, args});
            });
            embeddedMetadata.relations = this._metadataArgsStorage.filterRelations(targets).map(args => {
                return new RelationMetadata({ entityMetadata, embeddedMetadata, args });
            });
            embeddedMetadata.listeners = this._metadataArgsStorage.filterListeners(targets).map(args => {
                return new EntityListenerMetadata({ entityMetadata, embeddedMetadata, args });
            });
            embeddedMetadata.indices = this._metadataArgsStorage.filterIndices(targets).map(args => {
                return new IndexMetadata({ entityMetadata, embeddedMetadata, args });
            });
            embeddedMetadata.relationIds = this._metadataArgsStorage.filterRelationIds(targets).map(args => {
                return new RelationIdMetadata({ entityMetadata, args });
            });
            embeddedMetadata.relationCounts = this._metadataArgsStorage.filterRelationCounts(targets).map(args => {
                return new RelationCountMetadata({ entityMetadata, args });
            });
            embeddedMetadata.embeddeds = this.createEmbeddedsRecursively(entityMetadata, this._metadataArgsStorage.filterEmbeddeds(targets));
            embeddedMetadata.embeddeds.forEach(subEmbedded => subEmbedded.parentEmbeddedMetadata = embeddedMetadata);
            entityMetadata.allEmbeddeds.push(embeddedMetadata);
            return embeddedMetadata;
        });
    }
createEmbeddedsRecursively ( entityMetadata , embeddedArgs ) { return embeddedArgs . map ( embeddedArgs => { const embeddedMetadata = new EmbeddedMetadata ( { entityMetadata : entityMetadata , args : embeddedArgs } ) ; const targets = MetadataUtils . getInheritanceTree ( embeddedMetadata . type ) ; embeddedMetadata . columns = this . _metadataArgsStorage . filterColumns ( targets ) . map ( args => { return new ColumnMetadata ( { connection : this . _connection , entityMetadata , embeddedMetadata , args } ) ; } ) ; embeddedMetadata . relations = this . _metadataArgsStorage . filterRelations ( targets ) . map ( args => { return new RelationMetadata ( { entityMetadata , embeddedMetadata , args } ) ; } ) ; embeddedMetadata . listeners = this . _metadataArgsStorage . filterListeners ( targets ) . map ( args => { return new EntityListenerMetadata ( { entityMetadata , embeddedMetadata , args } ) ; } ) ; embeddedMetadata . indices = this . _metadataArgsStorage . filterIndices ( targets ) . map ( args => { return new IndexMetadata ( { entityMetadata , embeddedMetadata , args } ) ; } ) ; embeddedMetadata . relationIds = this . _metadataArgsStorage . filterRelationIds ( targets ) . map ( args => { return new RelationIdMetadata ( { entityMetadata , args } ) ; } ) ; embeddedMetadata . relationCounts = this . _metadataArgsStorage . filterRelationCounts ( targets ) . map ( args => { return new RelationCountMetadata ( { entityMetadata , args } ) ; } ) ; embeddedMetadata . embeddeds = this . createEmbeddedsRecursively ( entityMetadata , this . _metadataArgsStorage . filterEmbeddeds ( targets ) ) ; embeddedMetadata . embeddeds . forEach ( subEmbedded => subEmbedded . parentEmbeddedMetadata = embeddedMetadata ) ; entityMetadata . allEmbeddeds . push ( embeddedMetadata ) ; return embeddedMetadata ; } ) ; }
Creates from the given embedded metadata args real embedded metadatas with its columns and relations,
 and does the same for all its sub-embeddeds (goes recursively).
Creates from the given embedded metadata args real embedded metadatas with its columns and relations and does the same for all its sub - embeddeds ( goes recursively ) .