assert context != null;
CreateView ast = target.ast;
assert context.get(ast.from.table) != null;
assert context.get(ast.from.join.table) != null;
JoinedModelBuilder builder = new JoinedModelBuilder(
ast.name.token,
context.get(ast.from.table),
ast.from.alias,
context.get(ast.from.join.table),
ast.from.join.alias);
builder.namespace(target.namespace);
// 結合条件
for (On on : ast.from.join.condition) {
builder.on(on.left.token, on.right.token);
}
// カラムの追加
for (Select select : ast.selectList) {
assert select.aggregator == Aggregator.IDENT;
builder.add(select.alias.token, select.name.token);
}
return builder.toDescription();
}