Package org.eclipse.persistence.internal.sessions

Examples of org.eclipse.persistence.internal.sessions.AbstractSession


            if (null == object) {
                return null;
            }
            int numberOfSessions = sessions.size();
            for (int x = 0; x < numberOfSessions; x++) {
                AbstractSession next = ((AbstractSession) sessions.get(x));
                XMLDescriptor xmlDescriptor = (XMLDescriptor) next.getDescriptor(object);
                if (xmlDescriptor != null) {
                    // we don't currently support document preservation
                    // and non-shared cache (via unit of work)
                    //if (!documentPreservationPolicy.shouldPreserveDocument()) {
                    next = next.acquireUnitOfWork();
                    //}
                    return next;
                }
            }
            throw XMLMarshalException.descriptorNotFoundInProject(object.getClass().getName());
View Full Code Here


            if (null == clazz) {
                return null;
            }
            int numberOfSessions = sessions.size();
            for (int x = 0; x < numberOfSessions; x++) {
                AbstractSession next = ((AbstractSession) sessions.get(x));
                if (next.getDescriptor(clazz) != null) {
                    return next;
                }
            }
            throw XMLMarshalException.descriptorNotFoundInProject(clazz.getName());
        }
View Full Code Here

            if (null == object) {
                return null;
            }
            int numberOfSessions = sessions.size();
            for (int x = 0; x < numberOfSessions; x++) {
                AbstractSession next = ((AbstractSession) sessions.get(x));
                if (next.getDescriptor(object) != null) {
                    return next;
                }
            }
            throw XMLMarshalException.descriptorNotFoundInProject(object.getClass().getName());
        }
View Full Code Here

            if (null == xmlDescriptor) {
                return null;
            }
            int numberOfSessions = sessions.size();
            for (int x = 0; x < numberOfSessions; x++) {
                AbstractSession next = ((AbstractSession) sessions.get(x));
                if (next.getProject().getOrderedDescriptors().contains(xmlDescriptor)) {
                    return next;
                }
            }
            throw XMLMarshalException.descriptorNotFoundInProject(xmlDescriptor.getJavaClass().getName());
        }
View Full Code Here

        //Iterate over the ORM descriptors and check for matching OXM descriptors
        Iterator ormDescriptors = ormSession.getDescriptors().values().iterator();
        while(ormDescriptors.hasNext()) {
            ClassDescriptor ormDescriptor = (ClassDescriptor)ormDescriptors.next();
            Class javaClass = ormDescriptor.getJavaClass();
            AbstractSession oxmSession = null;
            try {
                oxmSession = this.getSession(javaClass);
            } catch(XMLMarshalException ex) {
                //if we couldn't find a session for this class, we
                //don't have an OX descriptor for it.
            }
            if(oxmSession != null) {
                ClassDescriptor oxmDescriptor = oxmSession.getDescriptor(javaClass);
                //If we have an oxmDescriptor for this ORM descriptor, iterate over
                //mappings, and update the required OXM mappings attribute accessors
                Iterator<DatabaseMapping> ormMappings = ormDescriptor.getMappings().iterator();
                while(ormMappings.hasNext()) {
                    DatabaseMapping ormMapping = ormMappings.next();
View Full Code Here

        }

        boolean isXMLRoot = (object instanceof XMLRoot);
        XMLDescriptor xmlDescriptor = getDescriptor(object, isXMLRoot);

        AbstractSession session = xmlContext.getSession(xmlDescriptor);
        //if this is a simple xml root, the session and descriptor will be null
        if (!(isXMLRoot && ((XMLRoot)object).getObject() instanceof Node) && ((session == null) || !xmlContext.getDocumentPreservationPolicy(session).shouldPreserveDocument())) {
            if (result instanceof DOMResult) {
                DOMResult domResult = (DOMResult) result;
                // handle case where the node is null
View Full Code Here

                version = xroot.getXMLVersion() != null ? xroot.getXMLVersion() : version;
                encoding = xroot.getEncoding() != null ? xroot.getEncoding() : encoding;
            }
           
            if(encoding.equals(XMLConstants.DEFAULT_XML_ENCODING)){
                AbstractSession session = null;
                XMLDescriptor xmlDescriptor = null;
                if(isXMLRoot){
                    try{
                      session = xmlContext.getSession(((XMLRoot)object).getObject());
                      if(session != null){
View Full Code Here

            version = xroot.getXMLVersion() != null ? xroot.getXMLVersion() : version;
            encoding = xroot.getEncoding() != null ? xroot.getEncoding() : encoding;
        }

       
        AbstractSession session = null;
        XMLDescriptor xmlDescriptor = null;
        if(isXMLRoot){
          try{
              session = xmlContext.getSession(((XMLRoot)object).getObject());
              if(session != null){
View Full Code Here

        if ((object == null) || (contentHandler == null)) {
            throw XMLMarshalException.nullArgumentException();
        }
        boolean isXMLRoot = (object instanceof XMLRoot);
       
        AbstractSession session = null;
        XMLDescriptor xmlDescriptor = null;
        if(isXMLRoot){
          try{
              session = xmlContext.getSession(((XMLRoot)object).getObject());             
              if(session != null){
View Full Code Here

            throw XMLMarshalException.nullArgumentException();
        }
        try {
            boolean isXMLRoot = (object instanceof XMLRoot);
                                  
            AbstractSession session = null;
            XMLDescriptor xmlDescriptor = null;
            if(isXMLRoot){
              try{
                  session = xmlContext.getSession(((XMLRoot)object).getObject());
                  if(session != null){
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.internal.sessions.AbstractSession

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.