Examples of pcReplaceStateManager()


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

            // make sure we don't already have the instance cached
            checkForDuplicateId(id, 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 (!Boolean.FALSE.equals(sm.getMetaData().usesDetachedState()))
            detachedPC.pcSetDetachedState(getDetachedState(sm, fields));
        if (!_copy)
            sm.release(false, !_copy);
        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()

        if (!Boolean.FALSE.equals(sm.getMetaData().usesDetachedState()))
            detachedPC.pcSetDetachedState(getDetachedState(sm, fields));
        if (!_copy)
            sm.release(false, !_copy);
        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()

        manager.fireBeforeAttach(pc, meta);
        offset = meta.getIdentityType() == meta.ID_DATASTORE ? 1 : 0;

        // assign the detached pc the same state manager as the object we're
        // copying into during the attach process
        pc.pcReplaceStateManager(sm);
        BitSet fields = state == null ? null : (BitSet) state[1 + offset];
        try {
            FieldMetaData[] fmds = meta.getFields();
            for (int i = 0; i < fmds.length; i++) {
                // only attach fields in the FG of the detached instance; new
View Full Code Here

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

                if (fields == null || fields.get(i))
                    attachField(manager, pc, sm, fmds[i], true);
            }
        }
        finally {
            pc.pcReplaceStateManager(null);
        }

        // set the next version for non-new instances that are not embedded
        if (state != null && !embedded) {
            // make sure that all the fields in the original FG are loaded
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
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.