join = (Join) itr.next(); if (join.getType() == Join.TYPE_INNER) { if (join.getForeignKey() != null && !_dict.canOuterJoin(_joinSyntax, join.getForeignKey())) { Log log = _conf.getLog(JDBCConfiguration.LOG_JDBC); if (log.isWarnEnabled()) log.warn(_loc.get("cant-outer-fk", join.getForeignKey())); } else join.setType(Join.TYPE_OUTER);
join = (Join) itr.next(); if (join.getType() == Join.TYPE_INNER) { if (join.getForeignKey() != null && !_dict.canOuterJoin(_joinSyntax, join.getForeignKey())) { Log log = _conf.getLog(JDBCConfiguration.LOG_JDBC); if (log.isWarnEnabled()) log.warn(_loc.get("cant-outer-fk", join.getForeignKey())); } else join.setType(Join.TYPE_OUTER);
private SQLBuffer toCorrelatedJoin(Select sel, Join join, boolean forUpdate, boolean first) { if (join.getForeignKey() != null){ SQLBuffer where = new SQLBuffer(this); where.append("(").append(toTraditionalJoin(join)).append(")"); sel.where(where.getSQL()); } return null; }
join = (Join) itr.next(); if (join.getType() == Join.TYPE_INNER) { if (join.getForeignKey() != null && !_dict.canOuterJoin(_joinSyntax, join.getForeignKey())) { Log log = _conf.getLog(JDBCConfiguration.LOG_JDBC); if (log.isWarnEnabled()) log.warn(_loc.get("cant-outer-fk", join.getForeignKey())); } else join.setType(Join.TYPE_OUTER);
private SQLBuffer toCorrelatedJoin(Select sel, Join join, boolean forUpdate, boolean first) { if (join.getForeignKey() != null){ SQLBuffer where = new SQLBuffer(this); where.append("(").append(toTraditionalJoin(join)).append(")"); sel.where(where.getSQL()); } return null; }
private SQLBuffer toCorrelatedJoin(Select sel, Join join, boolean forUpdate, boolean first) { if (join.getForeignKey() != null){ SQLBuffer where = new SQLBuffer(this); where.append("(").append(toTraditionalJoin(join)).append(")"); sel.where(where.getSQL()); } return null; }
private SQLBuffer toCorrelatedJoin(Select sel, Join join, boolean forUpdate, boolean first) { if (join.getForeignKey() != null){ SQLBuffer where = new SQLBuffer(this); where.append("(").append(toTraditionalJoin(join)).append(")"); sel.where(where.getSQL()); } return null; }
private boolean correlatedJoinCondition(Join join, Select sel) { if (!join.isCorrelated()) return false; Iterator itr = sel.getJoinIterator(); boolean skip = false; //if table1 in join is in the main query, table2 is in //subquery, and table2 participates in other joins //in subquery, the join condition can only be placed in //the where clause in the subquery while (itr.hasNext()) { Join join1 = (Join) itr.next(); if (join == join1 && !join.isForeignKeyInversed()) { continue; } if (join.getIndex2() == join1.getIndex1() || join.getIndex2() == join1.getIndex2()) { skip = true; if (join.getForeignKey() != null){ SQLBuffer where = new SQLBuffer(this); where.append("(").append(toTraditionalJoin(join)).append(")"); sel.where(where.getSQL()); } break; } } return skip; }
private boolean correlatedJoinCondition(Join join, Select sel) { if (!join.isCorrelated()) return false; Iterator itr = sel.getJoinIterator(); boolean skip = false; //if table1 in join is in the main query, table2 is in //subquery, and table2 participates in other joins //in subquery, the join condition can only be placed in //the where clause in the subquery while (itr.hasNext()) { Join join1 = (Join) itr.next(); if (join == join1 && !join.isForeignKeyInversed()) { continue; } if (join.getIndex2() == join1.getIndex1() || join.getIndex2() == join1.getIndex2()) { skip = true; if (join.getForeignKey() != null){ SQLBuffer where = new SQLBuffer(this); where.append("(").append(toTraditionalJoin(join)).append(")"); sel.where(where.getSQL()); } break; } } return skip; }
private boolean correlatedJoinCondition(Join join, Select sel) { if (!join.isCorrelated()) return false; Iterator itr = sel.getJoinIterator(); boolean skip = false; //if table1 in join is in the main query, table2 is in //subquery, and table2 participates in other joins //in subquery, the join condition can only be placed in //the where clause in the subquery while (itr.hasNext()) { Join join1 = (Join) itr.next(); if (join == join1 && !join.isForeignKeyInversed()) { continue; } if (join.getIndex2() == join1.getIndex1() || join.getIndex2() == join1.getIndex2()) { skip = true; if (join.getForeignKey() != null){ SQLBuffer where = new SQLBuffer(this); where.append("(").append(toTraditionalJoin(join)).append(")"); sel.where(where.getSQL()); } break; } } return skip; }
private boolean correlatedJoinCondition(Join join, Select sel) { if (!join.isCorrelated()) return false; Iterator itr = sel.getJoinIterator(); boolean skip = false; //if table1 in join is in the main query, table2 is in //subquery, and table2 participates in other joins //in subquery, the join condition can only be placed in //the where clause in the subquery while (itr.hasNext()) { Join join1 = (Join) itr.next(); if (join == join1 && !join.isForeignKeyInversed()) { continue; } if (join.getIndex2() == join1.getIndex1() || join.getIndex2() == join1.getIndex2()) { skip = true; if (join.getForeignKey() != null){ SQLBuffer where = new SQLBuffer(this); where.append("(").append(toTraditionalJoin(join)).append(")"); sel.where(where.getSQL()); } break; } } return skip; }
buf.append(" ").append(tableForUpdateClause); if (join.getForeignKey() != null) buf.append(" ON ").append(toTraditionalJoin(join)); else if (requiresConditionForCrossJoin &&
/** * Use the given join instance to create SQL joining its tables in * the SQL92 style. */ public SQLBuffer toSQL92Join(Join join, boolean forUpdate, boolean first) { SQLBuffer buf = new SQLBuffer(this); if (first) { buf.append(join.getTable1()).append(" "). append(join.getAlias1()); if (forUpdate && tableForUpdateClause != null) buf.append(" ").append(tableForUpdateClause); } buf.append(" "); if (join.getType() == Join.TYPE_OUTER) buf.append(outerJoinClause); else if (join.getType() == Join.TYPE_INNER) buf.append(innerJoinClause); else // cross buf.append(crossJoinClause); buf.append(" "); buf.append(join.getTable2()).append(" ").append(join.getAlias2()); if (forUpdate && tableForUpdateClause != null) buf.append(" ").append(tableForUpdateClause); if (join.getForeignKey() != null) buf.append(" ON ").append(toTraditionalJoin(join)); else if (requiresConditionForCrossJoin && join.getType() == Join.TYPE_CROSS) buf.append(" ON (1 = 1)"); return buf; }
buf.append(" ").append(tableForUpdateClause); if (join.getForeignKey() != null) buf.append(" ON ").append(toTraditionalJoin(join)); else if (requiresConditionForCrossJoin &&
buf.append(" ").append(tableForUpdateClause); if (join.getForeignKey() != null) buf.append(" ON ").append(toTraditionalJoin(join)); else if (requiresConditionForCrossJoin &&
return toTraditionalJoin(join); ForeignKey fk = join.getForeignKey(); if (fk == null) return null;
return toTraditionalJoin(join); ForeignKey fk = join.getForeignKey(); if (fk == null) return null;
return toTraditionalJoin(join); ForeignKey fk = join.getForeignKey(); if (fk == null) return null;
return toTraditionalJoin(join); ForeignKey fk = join.getForeignKey(); if (fk == null) return null;
return toTraditionalJoin(join); ForeignKey fk = join.getForeignKey(); if (fk == null) return null;