return factory.createRsIterator(query, cld, this);
}
if(logger.isDebugEnabled()) logger.debug("Creating ChainingIterator for class ["+cld.getClassNameOfObject()+"]");
ChainingIterator chainingIter = new ChainingIterator();
// BRJ: add base class iterator
if (!cld.isInterface())
{
if(logger.isDebugEnabled()) logger.debug("Adding RsIterator for class ["+cld.getClassNameOfObject()+"] to ChainingIterator");
chainingIter.addIterator(factory.createRsIterator(query, cld, this));
}
Iterator extents = getDescriptorRepository().getAllConcreteSubclassDescriptors(cld).iterator();
while (extents.hasNext())
{
ClassDescriptor extCld = (ClassDescriptor) extents.next();
// read same table only once
if (chainingIter.containsIteratorForTable(extCld.getFullTableName()))
{
if(logger.isDebugEnabled()) logger.debug("Skipping class ["+extCld.getClassNameOfObject()+"]");
}
else
{
if(logger.isDebugEnabled()) logger.debug("Adding RsIterator of class ["+extCld.getClassNameOfObject()+"] to ChainingIterator");
// add the iterator to the chaining iterator.
chainingIter.addIterator(factory.createRsIterator(query, extCld, this));
}
}
return chainingIter;
}