Examples of XMLMarshalException


Examples of org.eclipse.persistence.exceptions.XMLMarshalException

                        return value;
                    }
                }
            }
            if(primaryKey.getPrimaryKey()[0] != null){
                XMLMarshalException e = XMLMarshalException.missingIDForIDRef(Object.class.getName(), primaryKey.getPrimaryKey());           
                if(handler != null){
                    SAXParseException saxParseException = new SAXParseException(e.getLocalizedMessage(), null, e);
                    try{
                        handler.warning(saxParseException);
                    }catch(SAXException saxException){
                        throw e;
                    }
                }
            }
            return null;
        } else {
            Object value = getValue(referenceTargetClass, primaryKey);
            if(null == value) {
                DatabaseMapping mapping = (DatabaseMapping) reference.getMapping();
                ClassDescriptor targetDescriptor = mapping.getReferenceDescriptor();
                if(targetDescriptor.hasInheritance()) {
                    InheritancePolicy inheritancePolicy = targetDescriptor.getInheritancePolicy();
                    List<ClassDescriptor> childDescriptors = inheritancePolicy.getAllChildDescriptors();
                    for(ClassDescriptor childDescriptor : childDescriptors) {
                        value = getValue(childDescriptor.getJavaClass(), primaryKey);
                        if(null != value) {
                            return value;
                        }
                    }
                }
            }
            if(value == null && (primaryKey.getPrimaryKey()[0] != null) ){              
                XMLMarshalException e = XMLMarshalException.missingIDForIDRef(referenceTargetClass.getName(), primaryKey.getPrimaryKey());
                if(handler != null){
                    SAXParseException saxParseException = new SAXParseException(e.getLocalizedMessage(), null, e);
                    try{
                        handler.warning(saxParseException);
                    }catch(SAXException saxException){
                        throw e;
                    }
View Full Code Here

Examples of org.eclipse.persistence.exceptions.XMLMarshalException

                Object fieldValue = xmlDirectMapping.getFieldValue(xmlDirectMapping.valueFromObject(objectValue, xmlDirectMapping.getField(), session), session, marshalRecord);
                QName schemaType = ((Field) xmlDirectMapping.getField()).getSchemaTypeForValue(fieldValue, session);
                if(fieldValue != null) {
                    marshalRecord.attribute(xPathFragment, namespaceResolver, fieldValue, schemaType);
                } else {
                    XMLMarshalException ex = XMLMarshalException.nullValueNotAllowed(this.xmlCompositeObjectMapping.getAttributeName(), this.xmlCompositeObjectMapping.getDescriptor().getJavaClass().getName());
                    try {
                        marshalRecord.getMarshaller().getErrorHandler().warning(new SAXParseException(null, null, ex));
                    } catch(Exception saxException) {
                        throw ex;
                    }
View Full Code Here

Examples of org.eclipse.persistence.exceptions.XMLMarshalException

                        return value;
                    }
                }
            }
            if(primaryKey.getPrimaryKey()[0] != null){
                XMLMarshalException e = XMLMarshalException.missingIDForIDRef(Object.class.getName(), primaryKey.getPrimaryKey());           
                if(handler != null){
                    SAXParseException saxParseException = new SAXParseException(e.getLocalizedMessage(), null, e);
                    try{
                        handler.warning(saxParseException);
                    }catch(SAXException saxException){
                        throw e;
                    }
                }
            }
            return null;
        } else {
            Object value = getValue(referenceTargetClass, primaryKey);
            if(null == value) {
                CoreMapping mapping = (CoreMapping) reference.getMapping();
                CoreDescriptor targetDescriptor = mapping.getReferenceDescriptor();
                if(targetDescriptor.hasInheritance()) {
                    CoreInheritancePolicy inheritancePolicy = targetDescriptor.getInheritancePolicy();
                    List<CoreDescriptor> childDescriptors = inheritancePolicy.getAllChildDescriptors();
                    for(CoreDescriptor childDescriptor : childDescriptors) {
                        value = getValue(childDescriptor.getJavaClass(), primaryKey);
                        if(null != value) {
                            return value;
                        }
                    }
                }
            }
            if(value == null && (primaryKey.getPrimaryKey()[0] != null) ){              
                XMLMarshalException e = XMLMarshalException.missingIDForIDRef(referenceTargetClass.getName(), primaryKey.getPrimaryKey());
                if(handler != null){
                    SAXParseException saxParseException = new SAXParseException(e.getLocalizedMessage(), null, e);
                    try{
                        handler.warning(saxParseException);
                    }catch(SAXException saxException){
                        throw e;
                    }
View Full Code Here

Examples of org.eclipse.persistence.exceptions.XMLMarshalException

                        return value;
                    }
                }
            }
            if(primaryKey.getPrimaryKey()[0] != null){
                XMLMarshalException e = XMLMarshalException.missingIDForIDRef(Object.class.getName(), primaryKey.getPrimaryKey());           
                if(handler != null){
                    SAXParseException saxParseException = new SAXParseException(e.getLocalizedMessage(), null, e);
                    try{
                        handler.warning(saxParseException);
                    }catch(SAXException saxException){
                        throw e;
                    }
                }
            }
            return null;
        } else {
            Object value = getValue(referenceTargetClass, primaryKey);
            if(null == value) {
                CoreMapping mapping = (CoreMapping) reference.getMapping();
                CoreDescriptor targetDescriptor = mapping.getReferenceDescriptor();
                if(targetDescriptor.hasInheritance()) {
                    CoreInheritancePolicy inheritancePolicy = targetDescriptor.getInheritancePolicy();
                    List<CoreDescriptor> childDescriptors = inheritancePolicy.getAllChildDescriptors();
                    for(CoreDescriptor childDescriptor : childDescriptors) {
                        value = getValue(childDescriptor.getJavaClass(), primaryKey);
                        if(null != value) {
                            return value;
                        }
                    }
                }
            }
            if(value == null && (primaryKey.getPrimaryKey()[0] != null) ){              
                XMLMarshalException e = XMLMarshalException.missingIDForIDRef(referenceTargetClass.getName(), primaryKey.getPrimaryKey());
                if(handler != null){
                    SAXParseException saxParseException = new SAXParseException(e.getLocalizedMessage(), null, e);
                    try{
                        handler.warning(saxParseException);
                    }catch(SAXException saxException){
                        throw e;
                    }
View Full Code Here

Examples of org.eclipse.persistence.exceptions.XMLMarshalException

                        return value;
                    }
                }
            }
            if(primaryKey.getPrimaryKey()[0] != null){
                XMLMarshalException e = XMLMarshalException.missingIDForIDRef(Object.class.getName(), primaryKey.getPrimaryKey());           
                if(handler != null){
                    SAXParseException saxParseException = new SAXParseException(e.getLocalizedMessage(), null, e);
                    try{
                        handler.warning(saxParseException);
                    }catch(SAXException saxException){
                        throw e;
                    }
                }
            }
            return null;
        } else {
            Object value = getValue(referenceTargetClass, primaryKey);
            if(null == value) {
                CoreMapping mapping = (CoreMapping) reference.getMapping();
                CoreDescriptor targetDescriptor = mapping.getReferenceDescriptor();
                if(targetDescriptor.hasInheritance()) {
                    CoreInheritancePolicy inheritancePolicy = targetDescriptor.getInheritancePolicy();
                    List<CoreDescriptor> childDescriptors = inheritancePolicy.getAllChildDescriptors();
                    for(CoreDescriptor childDescriptor : childDescriptors) {
                        value = getValue(childDescriptor.getJavaClass(), primaryKey);
                        if(null != value) {
                            return value;
                        }
                    }
                }
            }
            if(value == null && (primaryKey.getPrimaryKey()[0] != null) ){              
                XMLMarshalException e = XMLMarshalException.missingIDForIDRef(referenceTargetClass.getName(), primaryKey.getPrimaryKey());
                if(handler != null){
                    SAXParseException saxParseException = new SAXParseException(e.getLocalizedMessage(), null, e);
                    try{
                        handler.warning(saxParseException);
                    }catch(SAXException saxException){
                        throw e;
                    }
View Full Code Here

Examples of org.eclipse.persistence.exceptions.XMLMarshalException

                Object fieldValue = xmlDirectMapping.getFieldValue(xmlDirectMapping.valueFromObject(objectValue, xmlDirectMapping.getField(), session), session, marshalRecord);
                QName schemaType = ((Field) xmlDirectMapping.getField()).getSchemaTypeForValue(fieldValue, session);
                if(fieldValue != null) {
                    marshalRecord.attribute(xPathFragment, namespaceResolver, fieldValue, schemaType);
                } else {
                    XMLMarshalException ex = XMLMarshalException.nullValueNotAllowed(this.xmlCompositeObjectMapping.getAttributeName(), this.xmlCompositeObjectMapping.getDescriptor().getJavaClass().getName());
                    try {
                        marshalRecord.getMarshaller().getErrorHandler().warning(new SAXParseException(null, null, ex));
                    } catch(Exception saxException) {
                        throw ex;
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.