Search in sources :

Example 1 with Root_meta_relational_metamodel_Column_Impl

use of org.finos.legend.pure.generated.Root_meta_relational_metamodel_Column_Impl in project legend-engine by finos.

the class HelperRelationalBuilder method processDatabaseViewFirstPass.

public static View processDatabaseViewFirstPass(org.finos.legend.engine.protocol.pure.v1.model.packageableElement.store.relational.model.View srcView, Schema schema) {
    View view = new Root_meta_relational_metamodel_relation_View_Impl(srcView.name)._name(srcView.name);
    MutableList<Column> columns = ListIterate.collect(srcView.columnMappings, columnMapping -> new Root_meta_relational_metamodel_Column_Impl(columnMapping.name)._name(columnMapping.name)._type(new Root_meta_relational_metamodel_datatype_Varchar_Impl(""))._owner(view));
    RichIterable<Column> pk = ListIterate.collect(srcView.primaryKey, s -> columns.select(column -> s.equals(column._name())).getFirst());
    return view._columns(columns)._primaryKey(pk)._schema(schema);
}
Also used : Root_meta_relational_metamodel_relation_View_Impl(org.finos.legend.pure.generated.Root_meta_relational_metamodel_relation_View_Impl) Root_meta_relational_metamodel_datatype_Varchar_Impl(org.finos.legend.pure.generated.Root_meta_relational_metamodel_datatype_Varchar_Impl) TableAliasColumn(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.TableAliasColumn) Column(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.Column) Root_meta_relational_metamodel_Column_Impl(org.finos.legend.pure.generated.Root_meta_relational_metamodel_Column_Impl) View(org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.relation.View)

Aggregations

Root_meta_relational_metamodel_Column_Impl (org.finos.legend.pure.generated.Root_meta_relational_metamodel_Column_Impl)1 Root_meta_relational_metamodel_datatype_Varchar_Impl (org.finos.legend.pure.generated.Root_meta_relational_metamodel_datatype_Varchar_Impl)1 Root_meta_relational_metamodel_relation_View_Impl (org.finos.legend.pure.generated.Root_meta_relational_metamodel_relation_View_Impl)1 Column (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.Column)1 TableAliasColumn (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.TableAliasColumn)1 View (org.finos.legend.pure.m3.coreinstance.meta.relational.metamodel.relation.View)1