}
buffer.append(NULL);
}
public void visit(Join obj) {
TableReference leftItem = obj.getLeftItem();
if(useParensForJoins() && leftItem instanceof Join) {
buffer.append(Tokens.LPAREN);
append(leftItem);
buffer.append(Tokens.RPAREN);
} else {
append(leftItem);
}
buffer.append(Tokens.SPACE);
switch(obj.getJoinType()) {
case CROSS_JOIN:
buffer.append(CROSS);
break;
case FULL_OUTER_JOIN:
buffer.append(FULL)
.append(Tokens.SPACE)
.append(OUTER);
break;
case INNER_JOIN:
buffer.append(INNER);
break;
case LEFT_OUTER_JOIN:
buffer.append(LEFT)
.append(Tokens.SPACE)
.append(OUTER);
break;
case RIGHT_OUTER_JOIN:
buffer.append(RIGHT)
.append(Tokens.SPACE)
.append(OUTER);
break;
default: buffer.append(UNDEFINED);
}
buffer.append(Tokens.SPACE)
.append(JOIN)
.append(Tokens.SPACE);
TableReference rightItem = obj.getRightItem();
if(rightItem instanceof Join && (useParensForJoins() || obj.getJoinType() == Join.JoinType.CROSS_JOIN)) {
buffer.append(Tokens.LPAREN);
append(rightItem);
buffer.append(Tokens.RPAREN);
} else {