}
private List<ResourceFlyweight> getFlyWeightObjectGraphFromReportingQueryResults(List<Object[]> reportQueryResults) {
List<ResourceFlyweight> resources = new ArrayList<ResourceFlyweight>();
FlyweightCache flyweightCache = new FlyweightCache();
for (Object[] prefetched : reportQueryResults) {
// casts
int i = 0;
Integer resourceId = (Integer) prefetched[i++];
String resourceUuid = (String) prefetched[i++];
String resourceName = (String) prefetched[i++];
String resourceKey = (String) prefetched[i++];
Integer parentId = (Integer) prefetched[i++];
String parentName = (String) prefetched[i++];
AvailabilityType availType = (AvailabilityType) prefetched[i++];
Integer typeId = (Integer) prefetched[i++];
String typeName = (String) prefetched[i++];
String typePlugin = (String) prefetched[i++];
Boolean typeSingleton = (Boolean) prefetched[i++];
ResourceCategory typeCategory = (ResourceCategory) prefetched[i++];
String subCategory = (String) prefetched[i++];
//we don't need the resource type reference here, only in the cache
flyweightCache
.constructResourceType(typeId, typeName, typePlugin, typeSingleton, typeCategory, subCategory);
ResourceFlyweight resourceFlyweight = flyweightCache.constructResource(resourceId, resourceName,
resourceUuid, resourceKey, parentId, typeId, availType);
resources.add(resourceFlyweight);
}