ConstraintSplitter splitter = new ConstraintSplitter(
constraint, qomFactory,
merger.getLeftSelectors(), merger.getRightSelectors());
Source left = join.getLeft();
Constraint leftConstraint = splitter.getLeftConstraint();
QueryResult leftResult =
execute(null, left, leftConstraint, null, 0, -1);
List<Row> leftRows = new ArrayList<Row>();
for (Row row : JcrUtils.getRows(leftResult)) {
leftRows.add(row);
}
if (hasLanguageConstraint(splitter.getRightConstraint())) {
merger.setIncludeTranslationNode(true);
}
RowIterator rightRows;
Source right = join.getRight();
List<Constraint> rightConstraints =
merger.getRightJoinConstraints(leftRows);
if (rightConstraints.size() < 500) {
Constraint rightConstraint = Constraints.and(
qomFactory,
Constraints.or(qomFactory, rightConstraints),
splitter.getRightConstraint());
rightRows =
execute(null, right, rightConstraint, null, 0, -1).getRows();
} else {
List<Row> list = new ArrayList<Row>();
for (int i = 0; i < rightConstraints.size(); i += 500) {
Constraint rightConstraint = Constraints.and(
qomFactory,
Constraints.or(qomFactory, rightConstraints.subList(
i, Math.min(i + 500, rightConstraints.size()))),
splitter.getRightConstraint());
QueryResult rigthResult =