Examples of pcReplaceStateManager()


Examples of org.apache.openjpa.enhance.PersistenceCapable.pcReplaceStateManager()

        manager.fireBeforeAttach(toAttach, meta);

        // assign the detached pc the same state manager as the object we're
        // copying into during the attach process
        StateManager smBefore = pc.pcGetStateManager();
        pc.pcReplaceStateManager(sm);
        int detach = (isNew) ? DETACH_ALL : broker.getDetachState();
        FetchConfiguration fetch = broker.getFetchConfiguration();
        try {
            FieldMetaData[] fmds = meta.getFields();
            for (int i = 0; i < fmds.length; i++) {
View Full Code Here

Examples of org.apache.openjpa.enhance.PersistenceCapable.pcReplaceStateManager()

                        attachField(manager, toAttach, sm, fmds[i], false);
                        break;
                }
            }
        } finally {
            pc.pcReplaceStateManager(smBefore);
        }
        if (!embedded && !isNew)
            compareVersion(sm, pc);
        return ImplHelper.getManagedInstance(into);
    }
View Full Code Here

Examples of org.apache.openjpa.enhance.PersistenceCapable.pcReplaceStateManager()

                throw new ObjectExistsException(_loc.get("cache-exists",
                    obj.getClass().getName(), id)).setFailedObject(obj);

            // if had embedded sm, null it
            if (sm != null)
                pc.pcReplaceStateManager(null);

            // create new sm
            sm = new StateManagerImpl(id, meta, this);
            if ((_flags & FLAG_ACTIVE) != 0) {
                if (explicit)
View Full Code Here

Examples of org.apache.openjpa.enhance.PersistenceCapable.pcReplaceStateManager()

                StateManagerImpl copySM;
                PersistenceCapable pc;
                if (orig == null) {
                    copySM = sm;
                    pc = assertPersistenceCapable(obj);
                    pc.pcReplaceStateManager(sm);
                } else {
                    copySM = orig;
                    pc = orig.getPersistenceCapable();
                }
View Full Code Here

Examples of org.apache.openjpa.enhance.PersistenceCapable.pcReplaceStateManager()

                    copy.pcReplaceStateManager(null);
                } finally {
                    // if the instance didn't have a state manager to start,
                    // revert it to being transient
                    if (orig == null)
                        pc.pcReplaceStateManager(null);
                }
            } else {
                copy = PCRegistry.newInstance(type, sm, false);
                if ((_flags & FLAG_ACTIVE) != 0 && !_optimistic)
                    state = PCState.ECLEAN;
View Full Code Here

Examples of org.apache.openjpa.enhance.PersistenceCapable.pcReplaceStateManager()

        if (!(o instanceof PersistenceCapable))
            pc = ImplHelper.toPersistenceCapable(o, this);
        else
            pc = (PersistenceCapable) o;

        pc.pcReplaceStateManager(this);
        return pc;
    }
   
    public List<FieldMetaData> getMappedByIdFields() {
        return _mappedByIdFields;
View Full Code Here

Examples of org.apache.openjpa.enhance.PersistenceCapable.pcReplaceStateManager()

        // make sure we don't already have the instance cached
        checkForDuplicateId(id, obj, meta);

        // if had embedded sm, null it
        if (sm != null) {
            pc.pcReplaceStateManager(null);
        }

        // create new sm
        sm = newStateManagerImpl(id, meta);
        if ((_flags & FLAG_ACTIVE) != 0) {
View Full Code Here

Examples of org.apache.openjpa.enhance.PersistenceCapable.pcReplaceStateManager()

                StateManagerImpl copySM;
                PersistenceCapable pc;
                if (orig == null) {
                    copySM = sm;
                    pc = assertPersistenceCapable(obj);
                    pc.pcReplaceStateManager(sm);
                } else {
                    copySM = orig;
                    pc = orig.getPersistenceCapable();
                }
View Full Code Here

Examples of org.apache.openjpa.enhance.PersistenceCapable.pcReplaceStateManager()

                    copy.pcReplaceStateManager(null);
                } finally {
                    // if the instance didn't have a state manager to start,
                    // revert it to being transient
                    if (orig == null)
                        pc.pcReplaceStateManager(null);
                }
            } else {
                copy = PCRegistry.newInstance(type, sm, false);
                if ((_flags & FLAG_ACTIVE) != 0 && !_optimistic)
                    state = PCState.ECLEAN;
View Full Code Here

Examples of org.apache.openjpa.enhance.PersistenceCapable.pcReplaceStateManager()

        if (!(o instanceof PersistenceCapable))
            pc = ImplHelper.toPersistenceCapable(o, this);
        else
            pc = (PersistenceCapable) o;

        pc.pcReplaceStateManager(this);
        return pc;
    }
   
    public List<FieldMetaData> getMappedByIdFields() {
        return _mappedByIdFields;
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.