in src/main/java/org/apache/jackrabbit/ocm/manager/objectconverter/impl/ObjectConverterImpl.java [474:508]
public void retrieveMappedAttribute(Session session, Object object, String attributeName) {
String path = null;
ClassDescriptor classDescriptor = null;
try {
classDescriptor = getClassDescriptor(object.getClass());
String pathFieldName = classDescriptor.getPathFieldDescriptor().getFieldName();
path = (String) ReflectionUtils.getNestedProperty(object, pathFieldName);
Node node = session.getNode(path);
BeanDescriptor beanDescriptor = classDescriptor.getBeanDescriptor(attributeName);
if (beanDescriptor != null)
{
this.retrieveBeanField(session, beanDescriptor, node, object, true);
}
// Check if the attribute is a collection
else
{
CollectionDescriptor collectionDescriptor = classDescriptor.getCollectionDescriptor(attributeName);
if (collectionDescriptor != null)
{
this.retrieveCollectionField(session, collectionDescriptor, node, object, true);
}
else
{
throw new ObjectContentManagerException("Impossible to retrieve the mapped attribute. The attribute '" +
attributeName + "' is not a bean or a collection for the class : " + classDescriptor.getClassName());
}
}
} catch (PathNotFoundException pnfe) {
throw new ObjectContentManagerException("Impossible to get the object at " + path, pnfe);
} catch (RepositoryException re) {
throw new org.apache.jackrabbit.ocm.exception.RepositoryException("Impossible to get the object at " + path, re);
}
}