当前位置: 首页>>代码示例>>Java>>正文


Java Join.getOnExpression方法代码示例

本文整理汇总了Java中net.sf.jsqlparser.statement.select.Join.getOnExpression方法的典型用法代码示例。如果您正苦于以下问题:Java Join.getOnExpression方法的具体用法?Java Join.getOnExpression怎么用?Java Join.getOnExpression使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.sf.jsqlparser.statement.select.Join的用法示例。


在下文中一共展示了Join.getOnExpression方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visitJoin

import net.sf.jsqlparser.statement.select.Join; //导入方法依赖的package包/类
private void visitJoin(Join j) {
    if (j.getOnExpression() != null) {
        j.getOnExpression().accept(this);
    };
    if (j.getRightItem() != null) {
        j.getRightItem().accept(this);
    }
}
 
开发者ID:diennea,项目名称:herddb,代码行数:9,代码来源:JdbcQueryRewriter.java

示例2: 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(")");
    }

}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:49,代码来源:SelectDeParser.java

示例3: 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(")");
    }
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:47,代码来源:SelectDeParser.java

示例4: 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);
    }
    
}
 
开发者ID:valdasraps,项目名称:resthub,代码行数:52,代码来源:SqlParser.java

示例5: 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);
    }
    
}
 
开发者ID:valdasraps,项目名称:resthub,代码行数:55,代码来源:CheckSelectParser.java


注:本文中的net.sf.jsqlparser.statement.select.Join.getOnExpression方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。