AbstractRecord parentRow = row;
List<AbstractRecord> childRows = new ArrayList<AbstractRecord>();
childRows.add(row);
int parentIndex = getParentResultIndex();
// Must adjust for the parent index to ensure the correct pk is extracted.
Vector trimedFields = new NonSynchronizedSubVector(row.getFields(), parentIndex, row.size());
if (parentIndex > 0) {
Vector trimedValues = new NonSynchronizedSubVector(row.getValues(), parentIndex, row.size());
parentRow = new DatabaseRecord(trimedFields, trimedValues);
}
ObjectBuilder builder = getDescriptor().getObjectBuilder();
AbstractSession session = cursor.getExecutionSession();
// Extract the primary key of the source object, to filter only the joined rows for that object.
Object sourceKey = builder.extractPrimaryKeyFromRow(parentRow, session);
AbstractRecord extraRow = null;
while (true) {
AbstractRecord nextRow = null;
if (forward) {
nextRow = cursor.getAccessor().cursorRetrieveNextRow(cursor.getFields(), cursor.getResultSet(), session);
} else {
nextRow = cursor.getAccessor().cursorRetrievePreviousRow(cursor.getFields(), cursor.getResultSet(), session);
}
if (nextRow == null) {
break;
}
AbstractRecord nextParentRow = nextRow;
if (parentIndex > 0) {
Vector trimedValues = new NonSynchronizedSubVector(nextParentRow.getValues(), parentIndex, nextParentRow.size());
nextParentRow = new DatabaseRecord(trimedFields, trimedValues);
}
// Extract the primary key of the source object, to filter only the joined rows for that object.
Object nextKey = builder.extractPrimaryKeyFromRow(nextParentRow, session);
if ((sourceKey != null) && sourceKey.equals(nextKey)) {