public String getPath(Session session, Object object) {
ClassDescriptor classDescriptor = mapper.getClassDescriptorByClass(object.getClass());
final FieldDescriptor pathFieldDescriptor = classDescriptor.getPathFieldDescriptor();
if (pathFieldDescriptor == null) {
throw new JcrMappingException(
"Class of type: "
+ object.getClass().getName()
+ " has no path mapping. Maybe attribute path=\"true\" for a field element of this class in mapping descriptor is missing " +
" or maybe it is defined in an ancestor class which has no mapping descriptor.");
}