Package org.eclipse.persistence.internal.helper

Examples of org.eclipse.persistence.internal.helper.NonSynchronizedVector


    public Object invoke(XRServiceAdapter xrService, Invocation invocation) {

        DatabaseQuery query = queryHandler.getDatabaseQuery();
        Vector queryArguments = query.getArguments();
        int queryArgumentsSize = queryArguments.size();
        Vector executeArguments = new NonSynchronizedVector();
        for (int i = 0; i < queryArgumentsSize; i++) {
            String argName = (String)queryArguments.get(i);
            executeArguments.add(invocation.getParameter(argName));
        }
        Object value = xrService.getORSession().getActiveSession().executeQuery(query,
            executeArguments);
        if (value != null) {
            if (isSimpleXMLFormat()) {
View Full Code Here


    public Vector createPkVectorFromKey(Object key, AbstractSession session) {
        // If the descriptor primary key is mapped through direct-to-field mappings,
        // then no elaborate conversion is required.
        // If key is compound, add each value to the vector.
        KeyElementAccessor[] pkElementArray = this.getKeyClassFields(key.getClass());
        Vector pkVector = new NonSynchronizedVector(pkElementArray.length);
        for (int index = 0; index < pkElementArray.length; index++) {
            DatabaseMapping mapping = this.keyMappings[index];
            Object fieldValue = null;
            if (mapping.isDirectToFieldMapping()) {
                fieldValue = ((AbstractDirectMapping)mapping).getFieldValue(pkElementArray[index].getValue(key), session);
            } else {
                fieldValue = pkElementArray[index].getValue(key);
            }
            pkVector.add(fieldValue);
        }
        return pkVector;
    }
View Full Code Here

     */
    protected Object getQueryResults(AbstractSession session, AbstractRecord row, boolean checkExpiry) {
        // Check for null translation row.
        Vector arguments = null;
        if (row == null) {
            arguments =  new NonSynchronizedVector(1);
        } else {
            arguments =  row.getValues();
        }
        return session.getIdentityMapAccessorInstance().getQueryResult(this, arguments, checkExpiry);
    }
View Full Code Here

     * This will only be set if the query caches results.
     */
    protected void setQueryResults(Object resultFromQuery, AbstractRecord row, AbstractSession session) {
        Vector arguments = null;
        if (row == null) {
            arguments =  new NonSynchronizedVector(1);
        } else {
            arguments =  row.getValues();
        }
        session.getIdentityMapAccessorInstance().putQueryResult(this, arguments, resultFromQuery);
    }
View Full Code Here

     * The default constructor initializes the sourceToTargetKeyFieldAssociations
     * and sourceToTargetKeys data structures.
     */
    public XMLCollectionReferenceMapping() {
        sourceToTargetKeyFieldAssociations = new HashMap();
        sourceToTargetKeys = new NonSynchronizedVector();
        this.containerPolicy = ContainerPolicy.buildDefaultPolicy();
        this.usesSingleNode = false;
    }
View Full Code Here

         }

         @Override
         public Object getAttributeValueFromObject(Object object) throws DescriptorException {
           IsSetNullPolicy aPolicy = (IsSetNullPolicy)object;
            NonSynchronizedVector aCollection = new NonSynchronizedVector();
            for(int i = 0, size = aPolicy.getIsSetParameters().length; i<size;i++) {
              aCollection.add(aPolicy.getIsSetParameters()[i]);
            }
            return aCollection;
         }
View Full Code Here

         }

         @Override
         public Object getAttributeValueFromObject(Object object) throws DescriptorException {
           IsSetNullPolicy aPolicy = (IsSetNullPolicy)object;
            NonSynchronizedVector aCollection = new NonSynchronizedVector();
            for(int i = 0, size = aPolicy.getIsSetParameterTypes().length; i<size;i++) {
              aCollection.add(aPolicy.getIsSetParameterTypes()[i]);
            }
            return aCollection;
         }
View Full Code Here

        propertiesMapping.setAttributeName("properties");
        propertiesMapping.setReferenceClass(PropertyAssociation.class);
        propertiesMapping.setAttributeAccessor(new AttributeAccessor() {
            public Object getAttributeValueFromObject(Object object) {
                DatabaseMapping mapping = (DatabaseMapping)object;
                Vector propertyAssociations = new NonSynchronizedVector();
                for (Iterator i = mapping.getProperties().entrySet().iterator(); i.hasNext();) {
                    Map.Entry me = (Map.Entry)i.next();
                    PropertyAssociation propertyAssociation = new PropertyAssociation();
                    propertyAssociation.setKey(me.getKey());
                    propertyAssociation.setValue(me.getValue());
                    propertyAssociations.add(propertyAssociation);
                }
                return propertyAssociations;
            }

            public void setAttributeValueInObject(Object object, Object value) {
                DatabaseMapping mapping = (DatabaseMapping)object;
                Vector propertyAssociations = (Vector)value;
                for (int i = 0; i < propertyAssociations.size(); i++) {
                    PropertyAssociation propertyAssociation = (PropertyAssociation)propertyAssociations.get(i);
                    mapping.getProperties().put(propertyAssociation.getKey(), propertyAssociation.getValue());
                }
            }
        });
        propertiesMapping.setXPath(getSecondaryNamespaceXPath() + "properties/" + getSecondaryNamespaceXPath() + "property");
View Full Code Here

        propertiesMapping.setAttributeName("properties");
        propertiesMapping.setReferenceClass(PropertyAssociation.class);
        propertiesMapping.setAttributeAccessor(new AttributeAccessor() {
            public Object getAttributeValueFromObject(Object object) {
                ClassDescriptor desc = (ClassDescriptor)object;
                Vector propertyAssociations = new NonSynchronizedVector();
                for (Iterator i = desc.getProperties().entrySet().iterator(); i.hasNext();) {
                    Map.Entry me = (Map.Entry)i.next();
                    PropertyAssociation propertyAssociation = new PropertyAssociation();
                    propertyAssociation.setKey(me.getKey());
                    propertyAssociation.setValue(me.getValue());
                    propertyAssociations.add(propertyAssociation);
                }
                return propertyAssociations;
            }

            public void setAttributeValueInObject(Object object, Object value) {
                ClassDescriptor desc = (ClassDescriptor)object;
                Vector propertyAssociations = (Vector)value;
                for (int i = 0; i < propertyAssociations.size(); i++) {
                    PropertyAssociation propertyAssociation = (PropertyAssociation)propertyAssociations.get(i);
                    desc.getProperties().put(propertyAssociation.getKey(), propertyAssociation.getValue());
                }
            }
        });
        propertiesMapping.setXPath(getSecondaryNamespaceXPath() + "properties/" + getSecondaryNamespaceXPath() + "property");
View Full Code Here

     */
    public SessionEventManager clone(Session newSession) {
        SessionEventManager newManager = (SessionEventManager)clone();
        newManager.setSession(newSession);
        if (this.listeners != null) {
            newManager.setListeners(new NonSynchronizedVector(this.listeners));
        }
        return newManager;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.internal.helper.NonSynchronizedVector

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.