protected Query[] buildPrefetchQueries(Collection proxies, Collection realSubjects)
{
Collection queries = new ArrayList();
Collection idsSubset;
Object proxy;
IndirectionHandler handler;
Identity id;
Class realClass;
HashMap classToIds = new HashMap();
Class topLevelClass = getItemClassDescriptor().getClassOfObject();
PersistenceBroker pb = getBroker();
ObjectCache cache = pb.serviceObjectCache();
for (Iterator it = proxies.iterator(); it.hasNext(); )
{
proxy = it.next();
handler = ProxyHelper.getIndirectionHandler(proxy);
if (handler == null)
{
continue;
}
id = handler.getIdentity();
if (cache.lookup(id) != null)
{
realSubjects.add(pb.getObjectByIdentity(id));
continue;
}