Package org.apache.jackrabbit.ocm.exception

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


            Class elementClass = ReflectionUtils.forName(elementClassName);
            // For multi value collections, only Collections are supported
            if (! (objects instanceof ManageableCollection))
            {

              throw new JcrMappingException("Impossible to retrieve the attribute "
                  + collectionDescriptor.getFieldName() + " in the class "
                  + collectionDescriptor.getClassDescriptor().getClassName()
                  " because it is not a collection");
            }
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

  private void validateClassName() {
    try {
            ReflectionUtils.forName(this.className);
    } catch (JcrMappingException e) {
       throw new JcrMappingException("Class used in descriptor not found : " + className);
    }
  }
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

  }
  protected String getCollectionJcrName(CollectionDescriptor descriptor) {
    String jcrName = descriptor.getJcrName();

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

    return jcrName;
  }
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 = parentNode.addNode(jcrName);
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.