.getParentDataDomain()
.getMaxIdQualifierSize();
List<PrefetchSelectQuery> queries = new ArrayList<PrefetchSelectQuery>();
int qualifiersCount = 0;
PrefetchSelectQuery currentQuery = null;
for (Object dataRow : parentDataRows) {
Expression allJoinsQualifier = null;
List<DbJoin> joins = lastDbRelationship.getJoins();
// handling too big qualifiers
if (currentQuery == null
|| (maxIdQualifierSize > 0 && qualifiersCount + joins.size() > maxIdQualifierSize)) {
currentQuery = new PrefetchSelectQuery(node.getPath(), relationship);
queries.add(currentQuery);
qualifiersCount = 0;
}
for (DbJoin join : joins) {
Object targetValue = ((DataRow) dataRow).get(join.getSourceName());
Expression joinQualifier = ExpressionFactory.matchDbExp(pathPrefix
+ join.getTargetName(), targetValue);
if (allJoinsQualifier == null) {
allJoinsQualifier = joinQualifier;
}
else {
allJoinsQualifier = allJoinsQualifier.andExp(joinQualifier);
}
}
currentQuery.orQualifier(allJoinsQualifier);
qualifiersCount += joins.size();
}
PrefetchTreeNode jointSubtree = node.cloneJointSubtree();