public void configureNestedRow(AbstractRecord parent, AbstractRecord child) { XMLRecord parentRecord = (XMLRecord) parent; XMLRecord childRecord = (XMLRecord) child; childRecord.setUnmarshaller(parentRecord.getUnmarshaller()); childRecord.setOwningObject(parentRecord.getCurrentObject()); }
public void configureNestedRow(AbstractRecord parent, AbstractRecord child) { XMLRecord parentRecord = (XMLRecord) parent; XMLRecord childRecord = (XMLRecord) child; childRecord.setUnmarshaller(parentRecord.getUnmarshaller()); childRecord.setOwningObject(parentRecord.getCurrentObject()); }
public void configureNestedRow(AbstractRecord parent, AbstractRecord child) { XMLRecord parentRecord = (XMLRecord) parent; XMLRecord childRecord = (XMLRecord) child; childRecord.setUnmarshaller(parentRecord.getUnmarshaller()); childRecord.setOwningObject(parentRecord.getCurrentObject()); }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session) throws XMLMarshalException { XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); QName rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session) throws XMLMarshalException { XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); QName rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session) throws XMLMarshalException { XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); QName rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session, QName rootQName) throws XMLMarshalException { if (rootQName == null) { rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); } XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { if (!((getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) || (getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT))) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session, QName rootQName) throws XMLMarshalException { if (rootQName == null) { rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); } XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { if (!((getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) || (getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT))) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session, QName rootQName) throws XMLMarshalException { if (rootQName == null) { rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); } XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { if (!((getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) || (getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT))) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session, QName rootQName) throws XMLMarshalException { if (rootQName == null) { rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); } XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { if (!((getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) || (getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT))) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session, QName rootQName) throws XMLMarshalException { if (rootQName == null) { rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); } XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { if (!((getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) || (getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT))) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session, QName rootQName) throws XMLMarshalException { if (rootQName == null) { rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); } XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { if (!(getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT || getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session, QName rootQName) throws XMLMarshalException { if (rootQName == null) { rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); } XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { if (!((getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) || (getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT))) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session, QName rootQName) throws XMLMarshalException { if (rootQName == null) { rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); } XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { if (!(getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT || getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } } return xmlDescriptor; }
protected XMLDescriptor getDescriptor(XMLRecord xmlRecord, AbstractSession session, QName rootQName) throws XMLMarshalException { if (rootQName == null) { rootQName = new QName(xmlRecord.getNamespaceURI(), xmlRecord.getLocalName()); } XMLContext xmlContext = xmlRecord.getUnmarshaller().getXMLContext(); XMLDescriptor xmlDescriptor = xmlContext.getDescriptor(rootQName); if (null == xmlDescriptor) { if (!(getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT || getKeepAsElementPolicy() == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) { throw XMLMarshalException.noDescriptorWithMatchingRootElement(xmlRecord.getLocalName()); } } return xmlDescriptor; }
public Object valueFromRow(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, CacheKey cacheKey, AbstractSession executionSession, boolean isTargetProtected, Boolean[] wasCacheUsed) throws DatabaseException { List<XMLEntry> values = ((DOMRecord)row).getValuesIndicatingNoEntry(this.getFields()); Object container = getContainerPolicy().containerInstance(values.size()); for(XMLEntry next:values) { Field valueField = next.getXMLField(); DatabaseMapping nextMapping = (DatabaseMapping)this.choiceElementMappings.get(valueField); if(nextMapping.isAbstractCompositeCollectionMapping()) { XMLCompositeCollectionMapping xmlMapping = (XMLCompositeCollectionMapping)nextMapping; Object value = xmlMapping.buildObjectFromNestedRow((AbstractRecord)next.getValue(), joinManager, sourceQuery, executionSession, isTargetProtected); value = convertDataValueToObjectValue(value, executionSession, ((XMLRecord) row).getUnmarshaller()); getContainerPolicy().addInto(value, container, executionSession); } else if(nextMapping instanceof XMLCompositeDirectCollectionMapping){ XMLCompositeDirectCollectionMapping xmlMapping = (XMLCompositeDirectCollectionMapping)nextMapping; Object value = next.getValue(); value = convertDataValueToObjectValue(value, executionSession, ((XMLRecord) row).getUnmarshaller()); getContainerPolicy().addInto(value, container, executionSession); } } ArrayList<XMLMapping> processedMappings = new ArrayList<XMLMapping>(); for(XMLMapping mapping:choiceElementMappings.values()) { if(((DatabaseMapping)mapping).isObjectReferenceMapping() && ((DatabaseMapping)mapping).isCollectionMapping() && !(processedMappings.contains(mapping))) { ((XMLCollectionReferenceMapping)mapping).readFromRowIntoObject(row, joinManager, ((XMLRecord)row).getCurrentObject(), cacheKey, sourceQuery, executionSession, isTargetProtected, container); processedMappings.add(mapping); } } return container; }
public Object valueFromRow(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery sourceQuery, CacheKey cacheKey, AbstractSession executionSession, boolean isTargetProtected, Boolean[] wasCacheUsed) throws DatabaseException { List<XMLEntry> values = ((DOMRecord)row).getValuesIndicatingNoEntry(this.getFields()); Object container = getContainerPolicy().containerInstance(values.size()); for(XMLEntry next:values) { Field valueField = next.getXMLField(); DatabaseMapping nextMapping = (DatabaseMapping)this.choiceElementMappings.get(valueField); if(nextMapping.isAbstractCompositeCollectionMapping()) { XMLCompositeCollectionMapping xmlMapping = (XMLCompositeCollectionMapping)nextMapping; Object value = xmlMapping.buildObjectFromNestedRow((AbstractRecord)next.getValue(), joinManager, sourceQuery, executionSession, isTargetProtected); value = convertDataValueToObjectValue(value, executionSession, ((XMLRecord) row).getUnmarshaller()); getContainerPolicy().addInto(value, container, executionSession); } else if(nextMapping instanceof XMLCompositeDirectCollectionMapping){ XMLCompositeDirectCollectionMapping xmlMapping = (XMLCompositeDirectCollectionMapping)nextMapping; Object value = next.getValue(); value = convertDataValueToObjectValue(value, executionSession, ((XMLRecord) row).getUnmarshaller()); getContainerPolicy().addInto(value, container, executionSession); } } ArrayList<XMLMapping> processedMappings = new ArrayList<XMLMapping>(); for(XMLMapping mapping:choiceElementMappings.values()) { if(((DatabaseMapping)mapping).isObjectReferenceMapping() && ((DatabaseMapping)mapping).isCollectionMapping() && !(processedMappings.contains(mapping))) { ((XMLCollectionReferenceMapping)mapping).readFromRowIntoObject(row, joinManager, ((XMLRecord)row).getCurrentObject(), cacheKey, sourceQuery, executionSession, isTargetProtected, container); processedMappings.add(mapping); } } return container; }
if(converter != null) { if (converter instanceof XMLConverter) { value = ((XMLConverter) converter).convertDataValueToObjectValue(value, executionSession, ((XMLRecord) row).getUnmarshaller()); } else { value = converter.convertDataValueToObjectValue(value, executionSession); if(converter != null) { if (converter instanceof XMLConverter) { value = ((XMLConverter) converter).convertDataValueToObjectValue(value, executionSession, ((XMLRecord) row).getUnmarshaller()); } else { value = converter.convertDataValueToObjectValue(value, executionSession);
attributeValue = ((XMLConverter)getConverter()).convertDataValueToObjectValue(attributeValue, session, record.getUnmarshaller()); } else { attributeValue = getConverter().convertDataValueToObjectValue(attributeValue, session);
if (hasValueConverter()) { if (getValueConverter() instanceof XMLConverter) { element = ((XMLConverter) getValueConverter()).convertDataValueToObjectValue(element, executionSession, ((XMLRecord) row).getUnmarshaller()); } else { element = getValueConverter().convertDataValueToObjectValue(element, executionSession);