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