Examples of pcReplaceStateManager()


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()

                    for (FieldMetaData fmd : cmd.getProxyFields()) {
                        if (loaded.get(fmd.getIndex())) {
                            detachProxyField(fmd, pc, sm, fm);
                        }
                    }
                    pc.pcReplaceStateManager(null);
                }
            }
        }
    }
View Full Code Here

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

        }

        // 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 = sm.getMetaData().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()

        if (!Boolean.FALSE.equals(sm.getMetaData().usesDetachedState()))
            detachedPC.pcSetDetachedState(getDetachedState(sm, fields));
        if (!_copy)
            sm.release(false, true);
        if (detSM != null)
            detachedPC.pcReplaceStateManager(detSM);
        return detachedPC;
    }

    private static boolean useDetachedStateManager(StateManagerImpl sm,
        DetachOptions opts) {
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()

                    for (FieldMetaData fmd : cmd.getProxyFields()) {
                        if (loaded.get(fmd.getIndex())) {
                            detachProxyField(fmd, pc, sm, _tsm);
                        }
                    }
                    pc.pcReplaceStateManager(null);
                }
            }
        }
    }
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.