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; }
return null; boolean inverse = join.isForeignKeyInversed(); Column[] from = (inverse) ? fk.getPrimaryKeyColumns() : fk.getColumns();
return null; boolean inverse = join.isForeignKeyInversed(); Column[] from = (inverse) ? fk.getPrimaryKeyColumns() : fk.getColumns();
return null; boolean inverse = join.isForeignKeyInversed(); Column[] from = (inverse) ? fk.getPrimaryKeyColumns() : fk.getColumns();
return null; boolean inverse = join.isForeignKeyInversed(); Column[] from = (inverse) ? fk.getPrimaryKeyColumns() : fk.getColumns();
return null; boolean inverse = join.isForeignKeyInversed(); Column[] from = (inverse) ? fk.getPrimaryKeyColumns() : fk.getColumns();
return null; boolean inverse = join.isForeignKeyInversed(); Column[] from = (inverse) ? fk.getPrimaryKeyColumns() : fk.getColumns();
return null; boolean inverse = join.isForeignKeyInversed(); Column[] from = (inverse) ? fk.getPrimaryKeyColumns() : fk.getColumns();
return null; boolean inverse = join.isForeignKeyInversed(); Column[] from = (inverse) ? fk.getPrimaryKeyColumns() : fk.getColumns();
return null; boolean inverse = join.isForeignKeyInversed(); Column[] from = (inverse) ? fk.getPrimaryKeyColumns() : fk.getColumns();
return null; boolean inverse = join.isForeignKeyInversed(); Column[] from = (inverse) ? fk.getPrimaryKeyColumns() : fk.getColumns();