本文整理汇总了Java中net.sf.jsqlparser.statement.select.Join.isSimple方法的典型用法代码示例。如果您正苦于以下问题:Java Join.isSimple方法的具体用法?Java Join.isSimple怎么用?Java Join.isSimple使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.jsqlparser.statement.select.Join
的用法示例。
在下文中一共展示了Join.isSimple方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toString
import net.sf.jsqlparser.statement.select.Join; //导入方法依赖的package包/类
@Override
public String toString() {
StringBuilder b = new StringBuilder("DELETE");
if( tables != null && tables.size() > 0){
b.append(" ");
for(Table t : tables){
b.append(t.toString());
}
}
b.append(" FROM ");
b.append(table);
if (joins != null) {
for (Join join : joins) {
if (join.isSimple()) {
b.append(", ").append(join);
} else {
b.append(" ").append(join);
}
}
}
if( where != null ){
b.append(" WHERE ").append(where);
}
if(orderByElements!=null){
b.append(PlainSelect.orderByToString(orderByElements));
}
if(limit != null){
b.append(limit);
}
return b.toString();
}
示例2: deParse
import net.sf.jsqlparser.statement.select.Join; //导入方法依赖的package包/类
public void deParse(Delete delete) {
buffer.append("DELETE");
if(delete.getTables() != null && delete.getTables().size() > 0){
for( Table table : delete.getTables() ){
buffer.append(" ").append(table.getFullyQualifiedName());
}
}
buffer.append(" FROM ").append(delete.getTable().toString());
if (delete.getJoins() != null) {
for (Join join : delete.getJoins()) {
if (join.isSimple()) {
buffer.append(", ").append(join);
} else {
buffer.append(" ").append(join);
}
}
}
if (delete.getWhere() != null) {
buffer.append(" WHERE ");
delete.getWhere().accept(expressionVisitor);
}
if(delete.getOrderByElements()!=null){
new OrderByDeParser(expressionVisitor, buffer).deParse(delete.getOrderByElements());
}
if (delete.getLimit() != null) {
new LimitDeparser(buffer).deParse(delete.getLimit());
}
}
示例3: toString
import net.sf.jsqlparser.statement.select.Join; //导入方法依赖的package包/类
@Override
public String toString() {
StringBuilder b = new StringBuilder("UPDATE ");
b.append(PlainSelect.getStringList(getTables(), true, false)).append(" SET ");
if (!useSelect) {
for (int i = 0; i < getColumns().size(); i++) {
if (i != 0) {
b.append(", ");
}
b.append(columns.get(i)).append(" = ");
b.append(expressions.get(i));
}
} else {
if (useColumnsBrackets) {
b.append("(");
}
for (int i = 0; i < getColumns().size(); i++) {
if (i != 0) {
b.append(", ");
}
b.append(columns.get(i));
}
if (useColumnsBrackets) {
b.append(")");
}
b.append(" = ");
b.append("(").append(select).append(")");
}
if (fromItem != null) {
b.append(" FROM ").append(fromItem);
if (joins != null) {
for (Join join : joins) {
if (join.isSimple()) {
b.append(", ").append(join);
} else {
b.append(" ").append(join);
}
}
}
}
if (where != null) {
b.append(" WHERE ");
b.append(where);
}
if (orderByElements!=null) {
b.append(PlainSelect.orderByToString(orderByElements));
}
if (limit != null) {
b.append(limit);
}
if (isReturningAllColumns()) {
b.append(" RETURNING *");
} else if (getReturningExpressionList() != null) {
b.append(" RETURNING ").append(PlainSelect.getStringList(getReturningExpressionList(), true, false));
}
return b.toString();
}
示例4: 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(")");
}
}
示例5: plainSelectToStringAppendWithNoLock
import net.sf.jsqlparser.statement.select.Join; //导入方法依赖的package包/类
private static String plainSelectToStringAppendWithNoLock(PlainSelect plain) {
StringBuilder sql = new StringBuilder("SELECT ");
if (plain.getDistinct() != null)
sql.append(plain.getDistinct()).append(" ");
if (plain.getTop() != null)
sql.append(plain.getTop()).append(" ");
sql.append(PlainSelect.getStringList(plain.getSelectItems()));
if (plain.getFromItem() != null) {
sql.append(" FROM ").append(plain.getFromItem()).append(" WITH (NOLOCK) ");
if (plain.getJoins() != null) {
Iterator<Join> it = plain.getJoins().iterator();
while (it.hasNext()) {
Join join = it.next();
if (join.isSimple()) {
sql.append(", ").append(join).append(" WITH (NOLOCK) ");
} else {
String temp = join.toString().replace(join.getRightItem().toString(),
join.getRightItem().toString() + " WITH (NOLOCK) ");
sql.append(" ").append(temp);
}
}
}
if (plain.getWhere() != null)
sql.append(" WHERE ").append(plain.getWhere());
if (plain.getOracleHierarchical() != null)
sql.append(plain.getOracleHierarchical().toString());
sql.append(PlainSelect.getFormatedList(plain.getGroupByColumnReferences(), "GROUP BY"));
if (plain.getHaving() != null)
sql.append(" HAVING ").append(plain.getHaving());
sql.append(PlainSelect.orderByToString(plain.isOracleSiblings(), plain.getOrderByElements()));
if (plain.getLimit() != null)
sql.append(plain.getLimit());
}
return sql.toString();
}
示例6: 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(")");
}
}