本文整理汇总了Java中net.sf.jsqlparser.statement.select.Join.getUsingColumns方法的典型用法代码示例。如果您正苦于以下问题:Java Join.getUsingColumns方法的具体用法?Java Join.getUsingColumns怎么用?Java Join.getUsingColumns使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.jsqlparser.statement.select.Join
的用法示例。
在下文中一共展示了Join.getUsingColumns方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deparseJoin
import net.sf.jsqlparser.statement.select.Join; //导入方法依赖的package包/类
public void deparseJoin(Join join) {
if (join.isSimple()) {
buffer.append(", ");
} else {
if (join.isRight()) {
buffer.append(" RIGHT");
} else if (join.isNatural()) {
buffer.append(" NATURAL");
} else if (join.isFull()) {
buffer.append(" FULL");
} else if (join.isLeft()) {
buffer.append(" LEFT");
} else if (join.isCross()) {
buffer.append(" CROSS");
}
if (join.isOuter()) {
buffer.append(" OUTER");
} else if (join.isInner()) {
buffer.append(" INNER");
} else if (join.isSemi()) {
buffer.append(" SEMI");
}
buffer.append(" JOIN ");
}
FromItem fromItem = join.getRightItem();
fromItem.accept(this);
if (join.getOnExpression() != null) {
buffer.append(" ON ");
join.getOnExpression().accept(expressionVisitor);
}
if (join.getUsingColumns() != null) {
buffer.append(" USING (");
for (Iterator<Column> iterator = join.getUsingColumns().iterator(); iterator.hasNext();) {
Column column = iterator.next();
buffer.append(column.toString());
if (iterator.hasNext()) {
buffer.append(", ");
}
}
buffer.append(")");
}
}
示例2: deparseJoin
import net.sf.jsqlparser.statement.select.Join; //导入方法依赖的package包/类
public void deparseJoin(Join join) {
if (join.isSimple()) {
buffer.append(join.getComment() != null ? join.getComment() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(", ");
} else {
buffer.append(" ");
if (join.isRight()) {
buffer.append(join.getCommentRight() != null ? join.getCommentRight() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("Right ");
} else if (join.isNatural()) {
buffer.append(join.getCommentNatural() != null ? join.getCommentNatural() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("Natural ");
} else if (join.isFull()) {
buffer.append(join.getCommentFull() != null ? join.getCommentFull() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("Full ");
} else if (join.isLeft()) {
buffer.append(join.getCommentLeft() != null ? join.getCommentLeft() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("Left ");
}
if (join.isOuter()) {
buffer.append(join.getCommentOuter() != null ? join.getCommentOuter() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("Outer ");
} else if (join.isInner()) {
buffer.append(join.getCommentInner() != null ? join.getCommentInner() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("Inner ");
}
buffer.append(join.getCommentJoin() != null ? join.getCommentJoin() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("Join ");
}
FromItem fromItem = join.getRightItem();
fromItem.accept(this);
if (join.getOnExpression() != null) {
buffer.append(join.getCommentOn() != null ? " " + join.getCommentOn() + ExpressionDeParser.LINE_SEPARATOR : "").append(" on ");
join.getOnExpression().accept(expressionVisitor);
}
if (join.getUsingColumns() != null) {
buffer.append(join.getCommentUsing() != null ? " " + join.getCommentUsing() + ExpressionDeParser.LINE_SEPARATOR : "").append(" Using")
.append(join.getCommentBeginBracket() != null ? " " + join.getCommentBeginBracket() + ExpressionDeParser.LINE_SEPARATOR : "").append(" ( ");
for (int i = 0, s = join.getUsingColumns().size(); i < s; i++) {
Column column = (Column) join.getUsingColumns().get(i);
buffer.append(column.getComment() != null ? column.getComment() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(column.getWholeColumnName());
if (i < join.getUsingColumns().size() - 1) {
buffer.append(!join.getCommentComma().get(i).toString().isEmpty() ? " " + join.getCommentComma().get(i) + " " + ExpressionDeParser.LINE_SEPARATOR : "");
buffer.append(", ");
}
}
buffer.append(join.getCommentEndBracket() != null ? join.getCommentEndBracket() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(")");
}
}
示例3: visit
import net.sf.jsqlparser.statement.select.Join; //导入方法依赖的package包/类
@Override
public void visit(PlainSelect ps) {
// First collect FROM and JOIN items
ps.getFromItem().accept(this);
if (ps.getJoins() != null) {
for (Join j : ps.getJoins()) {
j.getRightItem().accept(this);
if (j.getOnExpression() != null) {
j.getOnExpression().accept(this);
}
if (j.getUsingColumns() != null) {
for (Iterator it1 = j.getUsingColumns().iterator(); it1.hasNext();) {
((Expression) it1.next()).accept(this);
}
}
}
}
// Next iterate over SELECT, WHERE and ORDER BY items
for (Iterator it = ps.getSelectItems().iterator(); it.hasNext();) {
Object o = it.next();
if (o instanceof SelectExpressionItem) {
((SelectExpressionItem) o).accept(this);
}
if (o instanceof AllColumns) {
((AllColumns) o).accept(this);
}
if (o instanceof AllTableColumns) {
((AllTableColumns) o).accept(this);
}
}
if (ps.getWhere() != null) {
ps.getWhere().accept(this);
}
if (ps.getOrderByElements() != null) {
for (Iterator it = ps.getOrderByElements().iterator(); it.hasNext();) {
((OrderByElement) it.next()).accept(this);
}
}
if (ps.getOracleHierarchical() != null) {
ps.getOracleHierarchical().accept(this);
}
}
示例4: visit
import net.sf.jsqlparser.statement.select.Join; //导入方法依赖的package包/类
/**
* SelectVisitor
* @param ps
*/
@Override
public void visit(PlainSelect ps) {
// First collect FROM and JOIN items
ps.getFromItem().accept(this);
if (ps.getJoins() != null) {
for (Join j : ps.getJoins()) {
j.getRightItem().accept(this);
if (j.getOnExpression() != null) {
j.getOnExpression().accept(expParser);
}
if (j.getUsingColumns() != null) {
for (Iterator<?> it1 = j.getUsingColumns().iterator(); it1.hasNext();) {
((Expression) it1.next()).accept(expParser);
}
}
}
}
// Next iterate over SELECT, WHERE and ORDER BY items
for (Object o: ps.getSelectItems()) {
if (o instanceof SelectExpressionItem) {
((SelectExpressionItem) o).accept(this);
}
if (o instanceof AllColumns) {
((AllColumns) o).accept(this);
}
if (o instanceof AllTableColumns) {
((AllTableColumns) o).accept(this);
}
}
if (ps.getWhere() != null) {
ps.getWhere().accept(expParser);
}
if (ps.getOrderByElements() != null) {
for (Iterator<?> it = ps.getOrderByElements().iterator(); it.hasNext();) {
((OrderByElement) it.next()).accept(this);
}
}
if (ps.getOracleHierarchical() != null) {
ps.getOracleHierarchical().accept(expParser);
}
}