Package org.eclipse.persistence.internal.oxm

Examples of org.eclipse.persistence.internal.oxm.Reference


        // relevant for cache lookup - it must match the ordering of the
        // reference descriptor's primary key entries
        ClassDescriptor clsDescriptor = session.getClassDescriptor(getReferenceClass());
        Vector pkFieldNames = clsDescriptor.getPrimaryKeyFieldNames();
        // if reference is null, create a new instance and set it on the resolver
        Reference reference = resolver.getReference(this, srcObject);
        if (reference == null) {
            Vector pks = new Vector();
            pks.setSize(pkFieldNames.size());
            reference = new Reference(this, srcObject, getReferenceClass(), pks);
            resolver.addReference(reference);
            record.reference(reference);
        }
        XMLField tgtFld = (XMLField) getSourceToTargetKeyFieldAssociations().get(xmlField);
        int idx = pkFieldNames.indexOf(tgtFld.getXPath());
        Vector primaryKeys = reference.getPrimaryKeys();
        // fix for bug# 5687430
        // need to get the actual type of the target (i.e. int, String, etc.)
        // and use the converted value when checking the cache.
        Object value = session.getDatasourcePlatform().getConversionManager().convertObject(object, clsDescriptor.getTypedField(tgtFld).getType());
        if (value != null) {
View Full Code Here


        }
        // store the Reference instance on the resolver for use during mapping
        // resolution phase
        ReferenceResolver resolver = ReferenceResolver.getInstance(sourceQuery.getSession());
        if (resolver != null) {
            resolver.addReference(new Reference(this, targetObject, referenceClass, primaryKeys));
        }
        return null;
    }
View Full Code Here

        if (resolver == null) {
            return;
        }

        Object srcObject = record.getCurrentObject();
        Reference reference = resolver.getReference(this, srcObject);
        // if reference is null, create a new instance and set it on the resolver
        if (reference == null) {
            reference = new Reference(this, srcObject, getReferenceClass(), new HashMap());
            resolver.addReference(reference);
        }

        XMLField tgtFld = (XMLField) getSourceToTargetKeyFieldAssociations().get(xmlField);
        String tgtXPath = tgtFld.getXPath();
        Vector pks;
        HashMap primaryKeyMap = reference.getPrimaryKeyMap();
        if (primaryKeyMap.containsKey(tgtXPath)) {
            pks = (Vector) primaryKeyMap.get(tgtXPath);
        } else {
            pks = new Vector();
            primaryKeyMap.put(tgtXPath, pks);
View Full Code Here

            primaryKeyMap.put(tgtFld.getXPath(), newValues);
        }
        // store the Reference instance on the resolver for use during mapping resolution phase
        ReferenceResolver resolver = ReferenceResolver.getInstance(sourceQuery.getSession());
        if (resolver != null) {
            resolver.addReference(new Reference(this, targetObject, referenceClass, primaryKeyMap));
        }
        return null;
    }
View Full Code Here

        Object srcObject = record.getCurrentObject();
        // the order in which the primary keys are added to the vector is
        // relevant for cache lookup - it must match the ordering of the
        // reference descriptor's primary key entries

        Reference reference = resolver.getReference(this, srcObject);
        CacheId primaryKeys;
        if(null == referenceClass || ClassConstants.OBJECT == referenceClass) {
            if (reference == null) {
                // if reference is null, create a new instance and set it on the resolver
                primaryKeys = new CacheId(new Object[1]);
                reference = new Reference(this, srcObject, referenceClass, primaryKeys);
                resolver.addReference(reference);
                record.reference(reference);
            else {
                primaryKeys = (CacheId) reference.getPrimaryKey();
            }
            primaryKeys.set(0, object);
        } else {
            Vector pkFieldNames = referenceDescriptor.getPrimaryKeyFieldNames();
            // if reference is null, create a new instance and set it on the resolver
            if (reference == null) {
                primaryKeys = new CacheId(new Object[pkFieldNames.size()]);
                reference = new Reference(this, srcObject, referenceClass, primaryKeys);
                resolver.addReference(reference);
                record.reference(reference);
            } else {
                primaryKeys = (CacheId) reference.getPrimaryKey();
            }
            XMLField tgtFld = (XMLField) getSourceToTargetKeyFieldAssociations().get(xmlField);
            int idx = pkFieldNames.indexOf(tgtFld.getQualifiedName());
            // fix for bug# 5687430
            // need to get the actual type of the target (i.e. int, String, etc.)
View Full Code Here

        }
        // store the Reference instance on the resolver for use during mapping
        // resolution phase
        ReferenceResolver resolver = ((DOMRecord) databaseRow).getReferenceResolver();
        if (resolver != null) {
            resolver.addReference(new Reference(this, targetObject, referenceClass, primaryKeys));
        }
        return null;
    }
View Full Code Here

        // relevant for cache lookup - it must match the ordering of the
        // reference descriptor's primary key entries
        ClassDescriptor clsDescriptor = session.getClassDescriptor(getReferenceClass());
        Vector pkFieldNames = clsDescriptor.getPrimaryKeyFieldNames();
        // if reference is null, create a new instance and set it on the resolver
        Reference reference = resolver.getReference(this, srcObject);
        if (reference == null) {
            Vector pks = new Vector();
            pks.setSize(pkFieldNames.size());
            reference = new Reference(this, srcObject, getReferenceClass(), pks);
            resolver.addReference(reference);
            record.reference(reference);
        }
        XMLField tgtFld = (XMLField) getSourceToTargetKeyFieldAssociations().get(xmlField);
        int idx = pkFieldNames.indexOf(tgtFld.getXPath());
        Vector primaryKeys = reference.getPrimaryKeys();
        // fix for bug# 5687430
        // need to get the actual type of the target (i.e. int, String, etc.)
        // and use the converted value when checking the cache.
        Object value = session.getDatasourcePlatform().getConversionManager().convertObject(object, clsDescriptor.getTypedField(tgtFld).getType());
        if (value != null) {
View Full Code Here

        }
        // store the Reference instance on the resolver for use during mapping
        // resolution phase
        ReferenceResolver resolver = ReferenceResolver.getInstance(sourceQuery.getSession());
        if (resolver != null) {
            resolver.addReference(new Reference(this, targetObject, referenceClass, primaryKeys));
        }
        return null;
    }
View Full Code Here

        if (resolver == null) {
            return;
        }

        Object srcObject = record.getCurrentObject();
        Reference reference = resolver.getReference(this, srcObject);
        // if reference is null, create a new instance and set it on the resolver
        if (reference == null) {
            reference = new Reference(this, srcObject, getReferenceClass(), new HashMap());
            resolver.addReference(reference);
        }

        XMLField tgtFld = (XMLField) getSourceToTargetKeyFieldAssociations().get(xmlField);
        String tgtXPath = tgtFld.getXPath();
        Vector pks;
        HashMap primaryKeyMap = reference.getPrimaryKeyMap();
        if (primaryKeyMap.containsKey(tgtXPath)) {
            pks = (Vector) primaryKeyMap.get(tgtXPath);
        } else {
            pks = new Vector();
            primaryKeyMap.put(tgtXPath, pks);
View Full Code Here

            primaryKeyMap.put(tgtFld.getXPath(), newValues);
        }
        // store the Reference instance on the resolver for use during mapping resolution phase
        ReferenceResolver resolver = ReferenceResolver.getInstance(sourceQuery.getSession());
        if (resolver != null) {
            resolver.addReference(new Reference(this, targetObject, referenceClass, primaryKeyMap));
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.internal.oxm.Reference

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.