Package org.apache.jackrabbit.ocm.exception

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


                                      ManageableObjects objects) throws RepositoryException {

        // For maps of bean references, only Maps are supported
        if (!(objects instanceof ManageableMap)) {

            throw new JcrMappingException("Impossible to retrieve the attribute "
                    + collectionDescriptor.getFieldName() + " in the class "
                    + collectionDescriptor.getClassDescriptor().getClassName()
                    + " because it is not a map");
        }
View Full Code Here


                                      ManageableObjects objects) throws RepositoryException {

      // For maps of bean references, only Maps are supported
        if (!(objects instanceof ManageableMap)) {

            throw new JcrMappingException("Impossible to retrieve the attribute "
                    + collectionDescriptor.getFieldName() + " in the class "
                    + collectionDescriptor.getClassDescriptor().getClassName()
                    + " because it is not a map");
        }
        String jcrName = getCollectionJcrName(collectionDescriptor);
View Full Code Here

            ManageableObjects objects = ManageableObjectsUtil.getManageableObjects(collectionFieldClass);

            // For maps of bean references, only Maps are supported
            if (!(objects instanceof ManageableMap)) {

                throw new JcrMappingException("Impossible to retrieve the attribute "
                        + collectionDescriptor.getFieldName() + " in the class "
                        + collectionDescriptor.getClassDescriptor().getClassName()
                        + " because it is not a map");
            }
View Full Code Here

                if (object != null) {
                    ClassDescriptor classDescriptor = mapper.getClassDescriptorByClass(object.getClass());

                    FieldDescriptor fieldDescriptor = classDescriptor.getUuidFieldDescriptor();
                    if (fieldDescriptor == null) {
                        throw new JcrMappingException("The bean doesn't have an uuid - classdescriptor : "
                                + classDescriptor.getClassName());
                    }

                    String uuid = (String) ReflectionUtils.getNestedProperty(object, fieldDescriptor.getFieldName());
                    values[i] = valueFactory.createValue(MapReferenceValueEncoder.encodeKeyAndReference(key, uuid), PropertyType.STRING);
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

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

            Class converterClass= forName(className);

            return  ConstructorUtils.invokeConstructor(converterClass, params);
        }
        catch(Exception ex) {
            throw new JcrMappingException("Cannot create instance for class "  + className,  ex);
        }
    }
View Full Code Here

        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

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.