{
if (!collectionDescriptor.isAutoRetrieve() && !forceToRetrieve) {
return;
}
CollectionConverter collectionConverter = this.getCollectionConverter(session, collectionDescriptor);
Class collectionFieldClass = ReflectionUtils.getPropertyType(object, collectionDescriptor.getFieldName());
ManageableObjects objects = null;
if (collectionDescriptor.isProxy()) {
Object proxy = proxyManager.createCollectionProxy(session, collectionConverter, parentNode,
collectionDescriptor, collectionFieldClass);
ReflectionUtils.setNestedProperty(object, collectionDescriptor.getFieldName(), proxy);
}
else
{
objects = collectionConverter.getCollection(session, parentNode, collectionDescriptor, collectionFieldClass);
if (objects==null)
{
ReflectionUtils.setNestedProperty(object, collectionDescriptor.getFieldName(), null);
}
else