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);
}
Aggregations