Package org.eclipse.persistence.internal.queries

Examples of org.eclipse.persistence.internal.queries.ContainerPolicy.addInto()


                    if (next.getNodeValue().trim().length() > 0) {
                      objectValue = next.getNodeValue();
                        if(getConverter() != null) {
                          objectValue = getConverter().convertDataValueToObjectValue(objectValue, session, record.getUnmarshaller());
                        }                     
                        cp.addInto(objectValue, container, session);
                    }
                } else if (next.getNodeType() == Node.ELEMENT_NODE) {
                    ClassDescriptor referenceDescriptor = null;

                    //In this case it must be an element so we need to dig up the descriptor
View Full Code Here


                            ObjectBuilder builder = referenceDescriptor.getObjectBuilder();
                            objectValue = builder.buildObject(query, nestedRecord, joinManager);
                            if(getConverter() != null) {
                              objectValue = getConverter().convertDataValueToObjectValue(objectValue, session, record.getUnmarshaller());
                            }                     
                            cp.addInto(objectValue, container, session);
                        } else {
                            if ((keepAsElementPolicy == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) || (keepAsElementPolicy == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) {
                                XMLPlatformFactory.getInstance().getXMLPlatform().namespaceQualifyFragment((Element) next);
                                objectValue = next;
                                if(getConverter() != null) {
View Full Code Here

                                XMLPlatformFactory.getInstance().getXMLPlatform().namespaceQualifyFragment((Element) next);
                                objectValue = next;
                                if(getConverter() != null) {
                                  objectValue = getConverter().convertDataValueToObjectValue(objectValue, session, record.getUnmarshaller());
                                }                     
                                cp.addInto(objectValue, container, session);
                            }
                        }
                    } else {
                        String schemaType = ((Element) next).getAttributeNS(XMLConstants.SCHEMA_INSTANCE_URL, XMLConstants.SCHEMA_TYPE_ATTRIBUTE);
                        QName schemaTypeQName = null;
View Full Code Here

                            Object updated = ((XMLDescriptor) referenceDescriptor).wrapObjectInXMLRoot(objectValue, next.getNamespaceURI(), next.getLocalName(), next.getPrefix(), false);

                            if(getConverter() != null) {
                              updated = getConverter().convertDataValueToObjectValue(updated, session, record.getUnmarshaller());
                            }                     
                            cp.addInto(updated, container, session);
                        } else if ((referenceDescriptor == null) && (keepAsElementPolicy == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT)) {
                            XMLPlatformFactory.getInstance().getXMLPlatform().namespaceQualifyFragment((Element) next);
                            objectValue = next;
                            if(getConverter() != null) {
                              objectValue = getConverter().convertDataValueToObjectValue(objectValue, session, record.getUnmarshaller());
View Full Code Here

                            XMLPlatformFactory.getInstance().getXMLPlatform().namespaceQualifyFragment((Element) next);
                            objectValue = next;
                            if(getConverter() != null) {
                              objectValue = getConverter().convertDataValueToObjectValue(objectValue, session, record.getUnmarshaller());
                            }                     
                            cp.addInto(objectValue, container, session);
                        } else {
                            Object value = null;
                            Node textchild = ((Element) next).getFirstChild();
                            if ((textchild != null) && (textchild.getNodeType() == Node.TEXT_NODE)) {
                                value = ((Text) textchild).getNodeValue();
View Full Code Here

                                XMLRoot rootValue = new XMLRoot();
                                rootValue.setLocalName(next.getLocalName());
                                rootValue.setSchemaType(schemaTypeQName);
                                rootValue.setNamespaceURI(next.getNamespaceURI());
                                rootValue.setObject(value);
                                cp.addInto(rootValue, container, session);
                            }
                        }
                    }
                }
            }
View Full Code Here

              for (Iterator pkIt = reference.getPrimaryKeys().iterator(); pkIt.hasNext();) {
                Vector pkVector = (Vector) pkIt.next();
                    Object value = session.getIdentityMapAccessor().getFromIdentityMap(pkVector, reference.getTargetClass());
               
                    if (value != null) {
                      cPolicy.addInto(value, container,  session);
                    }
              }
              // for each reference, get the source object and add it to the container policy
              // when finished, set the policy on the mapping
              mapping.setAttributeValueInObject(reference.getSourceObject(), container);
View Full Code Here

        Iterator collectionIterator = collection.iterator();
        Object container = containerMapping.getContainerPolicy().containerInstance();
        while (collectionIterator.hasNext()) {
            Object collectionValue = collectionIterator.next();
            containerPolicy.addInto(collectionValue, container, session);
        }
        mapping.setAttributeValueInObject(entity, container);
    }

    public ValueStore copy() {
View Full Code Here

                descriptor.getObjectBuilder().buildAttributesIntoObject(arrayValue, nestedRow, query, null, false);
            } else if (isNestedStructure && (arrayValue instanceof Array)){
                arrayValue = buildContainerFromArray((Array)arrayValue, (ObjectRelationalDatabaseField)nestedType, session);
            }            
            
            cp.addInto(arrayValue, container, session);
        }
        return container;
     }

    /**
 
View Full Code Here

                    element = ((XMLConverter) getConverter()).convertDataValueToObjectValue(element, executionSession, ((XMLRecord) nestedRow).getUnmarshaller());
                } else {
                    element = getConverter().convertDataValueToObjectValue(element, executionSession);
                }
            }
            cp.addInto(element, result, sourceQuery.getSession());
            if(null != containerAccessor) {
                containerAccessor.setAttributeValueInObject(element, ((DOMRecord)nestedRow).getOwningObject());
            }
        }
        return result;
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.