Package org.apache.jackrabbit.ocm.exception

Examples of org.apache.jackrabbit.ocm.exception.JcrMappingException


        try {
            PropertyUtils.setNestedProperty(object, fieldName, value);
        }
        catch(Exception ex) {
            String className = (object == null) ? "<null>" : object.getClass().getName();
            throw new JcrMappingException("Cannot set the field " + fieldName + " in the class : " + className,
                    ex);
        }
    }
View Full Code Here


    public static Object newInstance(String clazz) {
        try {
            return forName(clazz).newInstance();
        }
        catch(Exception ex) {
            throw new JcrMappingException("Cannot create instance for class "  + clazz, ex);
        }
    }
View Full Code Here

    public static Class forName(String clazz) {
        try {
            return Class.forName(clazz, true, getClassLoader());
        }
        catch(Exception ex) {
            throw new JcrMappingException("Cannot load class " + clazz, ex);
        }
    }
View Full Code Here

    {
        String parentPath = "";
       
        if (!isValidPath(path))
        {
            throw new JcrMappingException("Invalid path : " + path);
        }
       
        String[] pathElements = path.split(PATH_SEPARATOR);        
       
        // Firts path element should be = empty string because a uri always start with '/'
View Full Code Here

       
        String[] pathElements = path.split(PATH_SEPARATOR);
       
        if (! isValidPath(path))
        {
            throw new JcrMappingException("Invalid path : " + path);
        }       
        return pathElements[pathElements.length-1];
    }
View Full Code Here

      }
     
      FieldDescriptor fieldDescriptor = beanClassDescriptor.getUuidFieldDescriptor();
      if (fieldDescriptor == null)
      {
        throw new JcrMappingException("The bean doesn't have an uuid - classdescriptor : " + beanClassDescriptor.getClassName());
      }
     
      String uuid = (String) ReflectionUtils.getNestedProperty(object, fieldDescriptor.getFieldName());
      parentNode.setProperty(beanDescriptor.getJcrName(), uuid, PropertyType.REFERENCE);
    } catch (Exception e) {
View Full Code Here

            if ( objects instanceof ManageableCollection)
              ((ManageableCollection)objects).addObject(item);
            else {
              if (!elementClassDescriptor.hasIdField())
              {
                throw new JcrMappingException("Impossible to use a map for the field : "
                                          + collectionDescriptor.getFieldName()
                                          + "in the class : " + collectionDescriptor.getCollectionClassName()
                                          + ". The element objects have no id field (check their OCM mapping)");
              }
              Object elementId = ReflectionUtils.getNestedProperty(item,
View Full Code Here

        }

        String jcrName = collectionDescriptor.getJcrName();

        if (jcrName == null) {
            throw new JcrMappingException(
                    "The JcrName attribute is not defined for the CollectionDescriptor : "
                    + collectionDescriptor.getFieldName() + " for the classdescriptor : " + collectionDescriptor.getClassDescriptor().getClassName());
        }

        Node collectionNode;
View Full Code Here

        try {
            return PropertyUtils.getNestedProperty(object, fieldName);
        }
        catch(IllegalAccessException e) {
            throw new JcrMappingException("Cannot access property "
                    + fieldName,
                    e);
        }
        catch(InvocationTargetException e) {
            throw new JcrMappingException("Cannot access property "
                    + fieldName,
                    e);
        }
        catch(NoSuchMethodException e) {
            throw new JcrMappingException("Cannot access property "
                    + fieldName,
                    e);
        }
    }
View Full Code Here

    public static Class getPropertyType(Object object, String fieldName) {
        try {
            return PropertyUtils.getPropertyType(object, fieldName);
        }
        catch(Exception ex) {
            throw new JcrMappingException("Cannot access property "
                    + fieldName,
                    ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.ocm.exception.JcrMappingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.