Package org.apache.ojb.otm.swizzle

Examples of org.apache.ojb.otm.swizzle.Swizzling


            int lock, boolean canCreate, Identity insertBeforeThis, Stack stack)
            throws LockingException
    {
        ContextEntry entry;
        LockManager lockManager;
        Swizzling swizzlingStrategy;
        IndirectionHandler handler = null;
        OTMKit kit = _tx.getKit();
        // Are we building object's relations for the userObject in the transaction?
        // Otherwise we just get data from the "userObject" and put it into
        // the previously loaded/created object in the transaction
        boolean buildingObject = false;
        boolean lazySwizzle = false;

        if (lock == LockType.NO_LOCK)
        {
            return null;
        }

        entry = (ContextEntry) _objects.get(oid);

        if (userObject == null)
        {
            // invalidating object...
            _original.remove(oid);
            _checkpointed.remove(oid);
            if (entry != null)
            {
                entry.userObject = null;
                entry.cacheObject = null;
            }
            return entry;
        }

        lockManager = LockManager.getInstance();
        swizzlingStrategy = kit.getSwizzlingStrategy();

        handler = ProxyHelper.getIndirectionHandler(userObject);
        if ((handler != null) && handler.alreadyMaterialized())
        {
            userObject = handler.getRealSubject();
            handler = null;
        }

        if ((entry == null) || (entry.userObject == null))
        {
            // first insertion of the userObject into editing context
            Object swizzledObject = swizzlingStrategy.swizzle(userObject, null, _pb, this);
            entry = new ContextEntry(swizzledObject);
            if (entry.handler != null)
            {
                ObjectCopyStrategy copyStrategy = _tx.getKit().getCopyStrategy(oid);
                entry.cacheObject = copyStrategy.copy(userObject, _pb);
                // Assume that object exists, otherwise were the proxy came from?
                _objects.put(oid, entry);
                lockManager.ensureLock(oid, _tx, lock, _pb); // lock after _objects.put to avoid hanged locks
                entry.handler.addListener(this);
            }
            else
            {
                Object origCacheObj = _pb.getObjectByIdentity(oid);

                if ((origCacheObj == null) && !canCreate)
                {
                    // we don't create the objects by reachability
                    throw new IllegalStateException("Related object is neither persistent, nor otm-depentent: " + oid);
                }
                if (origCacheObj != null)
                {
                    entry.cacheObject = origCacheObj;
                }
                buildingObject = true;
                _objects.put(oid, entry);
                lockManager.ensureLock(oid, _tx, lock, _pb); // lock after _objects.put to avoid hanged locks

                if (userObject != null)
                {
                    if ((origCacheObj == null) && canCreate)
                    {
                        ObjectCopyStrategy copyStrategy = _tx.getKit().getCopyStrategy(oid);
                        entry.cacheObject = copyStrategy.copy(userObject, _pb);
                        entry.state = State.PERSISTENT_NEW;
                        if (kit.isEagerInsert(userObject)
                                || hasBidirectionalAssociation(userObject.getClass()))
                        {
                            _pb.store(entry.cacheObject, entry.state);
                            entry.state = State.PERSISTENT_CLEAN;
                            origCacheObj = entry.cacheObject;
                        }
                    }

                    if (origCacheObj != null)
                    {
                        _original.put(oid, getFields(userObject, false, true));
                    }
                }
            }
            if (insertBeforeThis != null)
            {
                int insertIndex = _order.indexOf(insertBeforeThis);
                _order.add(insertIndex, oid);
            }
            else
            {
                _order.add(oid);
            }
        }
        else
        {
            // The object in context is the same object attempted an insert on
            // Ensure we have the correct lock level
            lockManager.ensureLock(oid, _tx, lock, _pb);

            if (handler == null)
            {
                if (!swizzlingStrategy.isSameInstance(entry.userObject, userObject))
                {
                    // the new object contains data to deal with
                    if (entry.handler != null)
                    {
                        // materialize old object even if it is not
                        // materialized yet, because we need a place
                        // to copy the data from the new object
                        entry.userObject = entry.handler.getRealSubject();
                        entry.handler = null;
                    }
                    // swizzle after lockReachableObjects(), when all related objects
                    // will be in the editing context
                    lazySwizzle = true;
                }
            }
        }

        // perform automatic read lock for all reachable objects
        // if the inserted object is materialized
        if ((handler == null) && !stack.contains(userObject))
        {
            stack.push(userObject);
            lockReachableObjects(oid, userObject, entry.cacheObject, lock, stack, buildingObject);
            stack.pop();
            if (lazySwizzle)
            {
                entry.userObject = swizzlingStrategy.swizzle(userObject, entry.userObject, _pb, this);
            }
        }

        return entry;
    }
View Full Code Here


        removeCollectionProxyListeners();

        ConnectionManagerIF connMan = _pb.serviceConnectionManager();
        boolean saveBatchMode = connMan.isBatchMode();
        Swizzling swizzlingStrategy = _tx.getKit().getSwizzlingStrategy();
        LockManager lockManager = LockManager.getInstance();
        Identity[] lockOrder = (Identity[]) _order.toArray(new Identity[_order.size()]);
        ObjectCache cache = _pb.serviceObjectCache();
        boolean isInsertVerified = _tx.getKit().isInsertVerified();
        ArrayList changedCollections = new ArrayList();

        // sort objects in the order of oid.hashCode to avoid deadlocks
        Arrays.sort(lockOrder, new Comparator()
        {
            public int compare(Object o1, Object o2)
            {
                return o1.hashCode() - o2.hashCode();
            }

            public boolean equals(Object obj)
            {
                return false;
            }
        });

        try {
            // mark dirty objects and lock them for write
            // also handle dependent objects and if there were inserted once,
            // repeat this process for their dependants ("cascade create")
            ArrayList newObjects = new ArrayList();
            int countNewObjects;
            do
            {
                newObjects.clear();
                countNewObjects = 0;
                for (int i = 0; i < lockOrder.length; i++)
                {
                    Identity oid = lockOrder[i];
                    ContextEntry entry = (ContextEntry) _objects.get(oid);
                    State state = entry.state;

                    if (entry.userObject == null) // invalidated
                    {
                        continue;
                    }

                    if (entry.handler == null) // materialized
                    {
                        if (!state.isDeleted())
                        {
                            Object[][] origFields = (Object[][]) _checkpointed.get(oid);
                            Object[][] newFields = getFields(entry.userObject, true, !isCommit);

                            if (origFields == null)
                            {
                                entry.needsCacheSwizzle = true;
                                newObjects.addAll(
                                        handleDependentReferences(oid, entry.userObject,
                                        null, newFields[0], newFields[2]));
                                newObjects.addAll(
                                        handleDependentCollections(oid, entry.userObject,
                                        null, newFields[1], newFields[3]));
                            }
                            else
                            {
                                if (isModified(origFields[0], newFields[0]))
                                {
                                    entry.state = state.markDirty();
                                    entry.needsCacheSwizzle = true;
                                    lockManager.ensureLock(oid, _tx, LockType.WRITE_LOCK, _pb);
                                    newObjects.addAll(
                                            handleDependentReferences(oid, entry.userObject,
                                            origFields[0], newFields[0], newFields[2]));
                                }

                                if (isModified(origFields[1], newFields[1]))
                                {
                                    // there are modified collections,
                                    // so we need to lock the object and to swizzle it to cache
                                    entry.needsCacheSwizzle = true;
                                    lockManager.ensureLock(oid, _tx, LockType.WRITE_LOCK, _pb);
                                    newObjects.addAll(
                                            handleDependentCollections(oid, entry.userObject,
                                            origFields[1], newFields[1], newFields[3]));
                                    changedCollections.add(oid);
                                }
                            }
                        }
                    }
                }
                countNewObjects = newObjects.size();
                if (countNewObjects > 0)
                {
                    // new objects are not locked, so we don't need to ensure the order
                    lockOrder = (Identity[]) newObjects.toArray(
                            new Identity[countNewObjects]);
                }
            }
            while (countNewObjects > 0);

            // Swizzle the context objects and the cache objects
            for (Iterator it = _order.iterator(); it.hasNext(); )
            {
                Identity oid = (Identity) it.next();
                ContextEntry entry = (ContextEntry) _objects.get(oid);

                if (entry.needsCacheSwizzle)
                {
                    entry.userObject = swizzlingStrategy.getRealTarget(entry.userObject);
                    entry.cacheObject = swizzlingStrategy.swizzle(
                    // we create the special ObjectCache implememntation
                            // that returns cacheObject, not userObject
                            entry.userObject, entry.cacheObject, _pb, new ObjectCache()
                            {
                                public Object lookup(Identity anOid)
View Full Code Here

            int lock, boolean canCreate, Identity insertBeforeThis, Stack stack)
            throws LockingException
    {
        ContextEntry entry;
        LockManager lockManager;
        Swizzling swizzlingStrategy;
        IndirectionHandler handler = null;
        OTMKit kit = _tx.getKit();
        // Are we building object's relations for the userObject in the transaction?
        // Otherwise we just get data from the "userObject" and put it into
        // the previously loaded/created object in the transaction
        boolean buildingObject = false;
        boolean lazySwizzle = false;

        if (lock == LockType.NO_LOCK)
        {
            return null;
        }

        entry = (ContextEntry) _objects.get(oid);

        if (userObject == null)
        {
            // invalidating object...
            _original.remove(oid);
            _checkpointed.remove(oid);
            if (entry != null)
            {
                entry.userObject = null;
                entry.cacheObject = null;
            }
            return entry;
        }

        lockManager = LockManager.getInstance();
        swizzlingStrategy = kit.getSwizzlingStrategy();

        handler = ProxyHelper.getIndirectionHandler(userObject);
        if ((handler != null) && handler.alreadyMaterialized())
        {
            userObject = handler.getRealSubject();
            handler = null;
        }

        if ((entry == null) || (entry.userObject == null))
        {
            // first insertion of the userObject into editing context
            Object swizzledObject = swizzlingStrategy.swizzle(userObject, null, _pb, this);
            entry = new ContextEntry(swizzledObject);
            if (entry.handler != null)
            {
                ObjectCopyStrategy copyStrategy = _tx.getKit().getCopyStrategy(oid);
                entry.cacheObject = copyStrategy.copy(userObject, _pb);
                // Assume that object exists, otherwise were the proxy came from?
                _objects.put(oid, entry);
                lockManager.ensureLock(oid, _tx, lock, _pb); // lock after _objects.put to avoid hanged locks
                entry.handler.addListener(this);
            }
            else
            {
                Object origCacheObj = _pb.getObjectByIdentity(oid);

                if ((origCacheObj == null) && !canCreate)
                {
                    // we don't create the objects by reachability
                    throw new IllegalStateException("Related object is neither persistent, nor otm-depentent: " + oid);
                }
                if (origCacheObj != null)
                {
                    entry.cacheObject = origCacheObj;
                }
                buildingObject = true;
                _objects.put(oid, entry);
                lockManager.ensureLock(oid, _tx, lock, _pb); // lock after _objects.put to avoid hanged locks

                if (userObject != null)
                {
                    if ((origCacheObj == null) && canCreate)
                    {
                        ObjectCopyStrategy copyStrategy = _tx.getKit().getCopyStrategy(oid);
                        entry.cacheObject = copyStrategy.copy(userObject, _pb);
                        entry.state = State.PERSISTENT_NEW;
                        if (kit.isEagerInsert(userObject)
                                || hasBidirectionalAssociation(userObject.getClass()))
                        {
                            _pb.store(entry.cacheObject, entry.state);
                            entry.state = State.PERSISTENT_CLEAN;
                            origCacheObj = entry.cacheObject;
                        }
                    }

                    if (origCacheObj != null)
                    {
                        _original.put(oid, getFields(userObject, false, true));
                    }
                }
            }
            if (insertBeforeThis != null)
            {
                int insertIndex = _order.indexOf(insertBeforeThis);
                _order.add(insertIndex, oid);
            }
            else
            {
                _order.add(oid);
            }
        }
        else
        {
            // The object in context is the same object attempted an insert on
            // Ensure we have the correct lock level
            lockManager.ensureLock(oid, _tx, lock, _pb);

            if (handler == null)
            {
                if (!swizzlingStrategy.isSameInstance(entry.userObject, userObject))
                {
                    // the new object contains data to deal with
                    if (entry.handler != null)
                    {
                        // materialize old object even if it is not
                        // materialized yet, because we need a place
                        // to copy the data from the new object
                        entry.userObject = entry.handler.getRealSubject();
                        entry.handler = null;
                    }
                    // swizzle after lockReachableObjects(), when all related objects
                    // will be in the editing context
                    lazySwizzle = true;
                }
            }
        }

        // perform automatic read lock for all reachable objects
        // if the inserted object is materialized
        if ((handler == null) && !stack.contains(userObject))
        {
            stack.push(userObject);
            lockReachableObjects(oid, userObject, entry.cacheObject, lock, stack, buildingObject);
            stack.pop();
            if (lazySwizzle)
            {
                entry.userObject = swizzlingStrategy.swizzle(userObject, entry.userObject, _pb, this);
            }
        }

        return entry;
    }
View Full Code Here

        removeCollectionProxyListeners();

        ConnectionManagerIF connMan = _pb.serviceConnectionManager();
        boolean saveBatchMode = connMan.isBatchMode();
        Swizzling swizzlingStrategy = _tx.getKit().getSwizzlingStrategy();
        LockManager lockManager = LockManager.getInstance();
        Identity[] lockOrder = (Identity[]) _order.toArray(new Identity[_order.size()]);
        ObjectCache cache = _pb.serviceObjectCache();
        boolean isInsertVerified = _tx.getKit().isInsertVerified();
        ArrayList changedCollections = new ArrayList();

        // sort objects in the order of oid.hashCode to avoid deadlocks
        Arrays.sort(lockOrder, new Comparator()
        {
            public int compare(Object o1, Object o2)
            {
                return o1.hashCode() - o2.hashCode();
            }

            public boolean equals(Object obj)
            {
                return false;
            }
        });

        try {
            // mark dirty objects and lock them for write
            // also handle dependent objects and if there were inserted once,
            // repeat this process for their dependants ("cascade create")
            ArrayList newObjects = new ArrayList();
            int countNewObjects;
            do
            {
                newObjects.clear();
                countNewObjects = 0;
                for (int i = 0; i < lockOrder.length; i++)
                {
                    Identity oid = lockOrder[i];
                    ContextEntry entry = (ContextEntry) _objects.get(oid);
                    State state = entry.state;

                    if (entry.userObject == null) // invalidated
                    {
                        continue;
                    }

                    if (entry.handler == null) // materialized
                    {
                        if (!state.isDeleted())
                        {
                            Object[][] origFields = (Object[][]) _checkpointed.get(oid);
                            Object[][] newFields = getFields(entry.userObject, true, !isCommit);

                            if (origFields == null)
                            {
                                entry.needsCacheSwizzle = true;
                                newObjects.addAll(
                                        handleDependentReferences(oid, entry.userObject,
                                        null, newFields[0], newFields[2]));
                                newObjects.addAll(
                                        handleDependentCollections(oid, entry.userObject,
                                        null, newFields[1], newFields[3]));
                            }
                            else
                            {
                                if (isModified(origFields[0], newFields[0]))
                                {
                                    entry.state = state.markDirty();
                                    entry.needsCacheSwizzle = true;
                                    lockManager.ensureLock(oid, _tx, LockType.WRITE_LOCK, _pb);
                                    newObjects.addAll(
                                            handleDependentReferences(oid, entry.userObject,
                                            origFields[0], newFields[0], newFields[2]));
                                }

                                if (isModified(origFields[1], newFields[1]))
                                {
                                    // there are modified collections,
                                    // so we need to lock the object and to swizzle it to cache
                                    entry.needsCacheSwizzle = true;
                                    lockManager.ensureLock(oid, _tx, LockType.WRITE_LOCK, _pb);
                                    newObjects.addAll(
                                            handleDependentCollections(oid, entry.userObject,
                                            origFields[1], newFields[1], newFields[3]));
                                    changedCollections.add(oid);
                                }
                            }
                        }
                    }
                }
                countNewObjects = newObjects.size();
                if (countNewObjects > 0)
                {
                    // new objects are not locked, so we don't need to ensure the order
                    lockOrder = (Identity[]) newObjects.toArray(
                            new Identity[countNewObjects]);
                }
            }
            while (countNewObjects > 0);

            // Swizzle the context objects and the cache objects
            for (Iterator it = _order.iterator(); it.hasNext(); )
            {
                Identity oid = (Identity) it.next();
                ContextEntry entry = (ContextEntry) _objects.get(oid);

                if (entry.needsCacheSwizzle)
                {
                    entry.userObject = swizzlingStrategy.getRealTarget(entry.userObject);
                    entry.cacheObject = swizzlingStrategy.swizzle(
                    // we create the special ObjectCache implememntation
                            // that returns cacheObject, not userObject
                            entry.userObject, entry.cacheObject, _pb, new ObjectCache()
                            {
                                public Object lookup(Identity anOid)
View Full Code Here

            int lock, boolean canCreate, Identity insertBeforeThis, Stack stack)
            throws LockingException
    {
        ContextEntry entry;
        LockManager lockManager;
        Swizzling swizzlingStrategy;
        IndirectionHandler handler = null;
        OTMKit kit = _tx.getKit();
        // Are we building object's relations for the userObject in the transaction?
        // Otherwise we just get data from the "userObject" and put it into
        // the previously loaded/created object in the transaction
        boolean buildingObject = false;
        boolean lazySwizzle = false;

        if (lock == LockType.NO_LOCK)
        {
            return null;
        }

        entry = (ContextEntry) _objects.get(oid);

        if (userObject == null)
        {
            // invalidating object...
            _original.remove(oid);
            _checkpointed.remove(oid);
            if (entry != null)
            {
                entry.userObject = null;
                entry.cacheObject = null;
            }
            return entry;
        }

        lockManager = LockManager.getInstance();
        swizzlingStrategy = kit.getSwizzlingStrategy();

        handler = ProxyHelper.getIndirectionHandler(userObject);
        if ((handler != null) && handler.alreadyMaterialized())
        {
            userObject = handler.getRealSubject();
            handler = null;
        }

        if ((entry == null) || (entry.userObject == null))
        {
            // first insertion of the userObject into editing context
            Object swizzledObject = swizzlingStrategy.swizzle(userObject, null, _pb, this);
            entry = new ContextEntry(swizzledObject);
            if (entry.handler != null)
            {
                ObjectCopyStrategy copyStrategy = _tx.getKit().getCopyStrategy(oid);
                entry.cacheObject = copyStrategy.copy(userObject, _pb);
                // Assume that object exists, otherwise were the proxy came from?
                _objects.put(oid, entry);
                lockManager.ensureLock(oid, _tx, lock, _pb); // lock after _objects.put to avoid hanged locks
                entry.handler.addListener(this);
            }
            else
            {
                Object origCacheObj = _pb.getObjectByIdentity(oid);

                if ((origCacheObj == null) && !canCreate)
                {
                    // we don't create the objects by reachability
                    throw new IllegalStateException("Related object is neither persistent, nor otm-depentent: " + oid);
                }
                if (origCacheObj != null)
                {
                    entry.cacheObject = origCacheObj;
                }
                buildingObject = true;
                _objects.put(oid, entry);
                lockManager.ensureLock(oid, _tx, lock, _pb); // lock after _objects.put to avoid hanged locks

                if (userObject != null)
                {
                    if ((origCacheObj == null) && canCreate)
                    {
                        ObjectCopyStrategy copyStrategy = _tx.getKit().getCopyStrategy(oid);
                        entry.cacheObject = copyStrategy.copy(userObject, _pb);
                        entry.state = State.PERSISTENT_NEW;
                        if (kit.isEagerInsert(userObject)
                                || hasBidirectionalAssociation(userObject.getClass()))
                        {
                            _pb.store(entry.cacheObject, entry.state);
                            entry.state = State.PERSISTENT_CLEAN;
                            origCacheObj = entry.cacheObject;
                        }
                    }

                    if (origCacheObj != null)
                    {
                        _original.put(oid, getFields(userObject, false, true));
                    }
                }
            }
            if (insertBeforeThis != null)
            {
                int insertIndex = _order.indexOf(insertBeforeThis);
                _order.add(insertIndex, oid);
            }
            else
            {
                _order.add(oid);
            }
        }
        else
        {
            // The object in context is the same object attempted an insert on
            // Ensure we have the correct lock level
            lockManager.ensureLock(oid, _tx, lock, _pb);

            if (handler == null)
            {
                if (!swizzlingStrategy.isSameInstance(entry.userObject, userObject))
                {
                    // the new object contains data to deal with
                    if (entry.handler != null)
                    {
                        // materialize old object even if it is not
                        // materialized yet, because we need a place
                        // to copy the data from the new object
                        entry.userObject = entry.handler.getRealSubject();
                        entry.handler = null;
                    }
                    // swizzle after lockReachableObjects(), when all related objects
                    // will be in the editing context
                    lazySwizzle = true;
                }
            }
        }

        // perform automatic read lock for all reachable objects
        // if the inserted object is materialized
        if ((handler == null) && !stack.contains(userObject))
        {
            stack.push(userObject);
            lockReachableObjects(oid, userObject, entry.cacheObject, lock, stack, buildingObject);
            stack.pop();
            if (lazySwizzle)
            {
                entry.userObject = swizzlingStrategy.swizzle(userObject, entry.userObject, _pb, this);
            }
        }

        return entry;
    }
View Full Code Here

        removeCollectionProxyListeners();

        ConnectionManagerIF connMan = _pb.serviceConnectionManager();
        boolean saveBatchMode = connMan.isBatchMode();
        Swizzling swizzlingStrategy = _tx.getKit().getSwizzlingStrategy();
        LockManager lockManager = LockManager.getInstance();
        Identity[] lockOrder = (Identity[]) _order.toArray(new Identity[_order.size()]);
        ObjectCache cache = _pb.serviceObjectCache();
        boolean isInsertVerified = _tx.getKit().isInsertVerified();
        ArrayList changedCollections = new ArrayList();

        // sort objects in the order of oid.hashCode to avoid deadlocks
        Arrays.sort(lockOrder, new Comparator()
        {
            public int compare(Object o1, Object o2)
            {
                return o1.hashCode() - o2.hashCode();
            }

            public boolean equals(Object obj)
            {
                return false;
            }
        });

        try {
            // mark dirty objects and lock them for write
            // also handle dependent objects and if there were inserted once,
            // repeat this process for their dependants ("cascade create")
            ArrayList newObjects = new ArrayList();
            int countNewObjects;
            do
            {
                newObjects.clear();
                countNewObjects = 0;
                for (int i = 0; i < lockOrder.length; i++)
                {
                    Identity oid = lockOrder[i];
                    ContextEntry entry = (ContextEntry) _objects.get(oid);
                    State state = entry.state;

                    if (entry.userObject == null) // invalidated
                    {
                        continue;
                    }

                    if (entry.handler == null) // materialized
                    {
                        if (!state.isDeleted())
                        {
                            Object[][] origFields = (Object[][]) _checkpointed.get(oid);
                            Object[][] newFields = getFields(entry.userObject, true, !isCommit);

                            if (origFields == null)
                            {
                                entry.needsCacheSwizzle = true;
                                newObjects.addAll(
                                        handleDependentReferences(oid, entry.userObject,
                                        null, newFields[0], newFields[2]));
                                newObjects.addAll(
                                        handleDependentCollections(oid, entry.userObject,
                                        null, newFields[1], newFields[3]));
                            }
                            else
                            {
                                if (isModified(origFields[0], newFields[0]))
                                {
                                    entry.state = state.markDirty();
                                    entry.needsCacheSwizzle = true;
                                    lockManager.ensureLock(oid, _tx, LockType.WRITE_LOCK, _pb);
                                    newObjects.addAll(
                                            handleDependentReferences(oid, entry.userObject,
                                            origFields[0], newFields[0], newFields[2]));
                                }

                                if (isModified(origFields[1], newFields[1]))
                                {
                                    // there are modified collections,
                                    // so we need to lock the object and to swizzle it to cache
                                    entry.needsCacheSwizzle = true;
                                    lockManager.ensureLock(oid, _tx, LockType.WRITE_LOCK, _pb);
                                    newObjects.addAll(
                                            handleDependentCollections(oid, entry.userObject,
                                            origFields[1], newFields[1], newFields[3]));
                                    changedCollections.add(oid);
                                }
                            }
                        }
                    }
                }
                countNewObjects = newObjects.size();
                if (countNewObjects > 0)
                {
                    // new objects are not locked, so we don't need to ensure the order
                    lockOrder = (Identity[]) newObjects.toArray(
                            new Identity[countNewObjects]);
                }
            }
            while (countNewObjects > 0);

            // Swizzle the context objects and the cache objects
            for (Iterator it = _order.iterator(); it.hasNext(); )
            {
                Identity oid = (Identity) it.next();
                ContextEntry entry = (ContextEntry) _objects.get(oid);

                if (entry.needsCacheSwizzle)
                {
                    entry.userObject = swizzlingStrategy.getRealTarget(entry.userObject);
                    entry.cacheObject = swizzlingStrategy.swizzle(
                    // we create the special ObjectCache implememntation
                            // that returns cacheObject, not userObject
                            entry.userObject, entry.cacheObject, _pb, new ObjectCache()
                            {
                                public Object lookup(Identity anOid)
View Full Code Here

TOP

Related Classes of org.apache.ojb.otm.swizzle.Swizzling

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.