Examples of pcIsDetached()


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

        // Make sure everything is detached and we can still use the Entity
        for (DMCustomerInventory c : root.getCustomerInventories()) {
            pc = (PersistenceCapable) c;
            assertTrue(pc.pcIsDetached());
            pc = (PersistenceCapable) c.getItem();
            assertTrue(pc.pcIsDetached());

        }
    }
}
View Full Code Here

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

            sm.getOwner().dirty(sm.getOwnerIndex());
            _cache.persist(sm);
            pc = sm.getPersistenceCapable();
        } else {
            pc = assertPersistenceCapable(obj);
            if (pc.pcIsDetached() == Boolean.TRUE) {
                throw new ObjectExistsException(_loc.get("persist-detached", Exceptions.toString(obj)))
                    .setFailedObject(obj);
            }
        }
View Full Code Here

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

            return false;

        PersistenceCapable pc = ImplHelper.toPersistenceCapable(obj, _conf);
        if (pc.pcGetStateManager() instanceof DetachedStateManager)
            return true;
        Boolean detached = pc.pcIsDetached();
        if (detached != null)
            return detached.booleanValue();

        if(!find){
            return false;
View Full Code Here

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

    }

    public void testCloseDetach() {
        root = em.merge(root);
        PersistenceCapable pc = (PersistenceCapable) root;
        assertFalse(pc.pcIsDetached());
        em.close();
        assertTrue(pc.pcIsDetached());
        // Make sure everything is detached and we can still use the Entity
        for (DMCustomerInventory c : root.getCustomerInventories()) {
            pc = (PersistenceCapable) c;
View Full Code Here

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

    public void testCloseDetach() {
        root = em.merge(root);
        PersistenceCapable pc = (PersistenceCapable) root;
        assertFalse(pc.pcIsDetached());
        em.close();
        assertTrue(pc.pcIsDetached());
        // Make sure everything is detached and we can still use the Entity
        for (DMCustomerInventory c : root.getCustomerInventories()) {
            pc = (PersistenceCapable) c;
            assertTrue(pc.pcIsDetached());
            pc = (PersistenceCapable) c.getItem();
View Full Code Here

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

        em.close();
        assertTrue(pc.pcIsDetached());
        // Make sure everything is detached and we can still use the Entity
        for (DMCustomerInventory c : root.getCustomerInventories()) {
            pc = (PersistenceCapable) c;
            assertTrue(pc.pcIsDetached());
            pc = (PersistenceCapable) c.getItem();
            assertTrue(pc.pcIsDetached());

        }
    }
View Full Code Here

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

        // Make sure everything is detached and we can still use the Entity
        for (DMCustomerInventory c : root.getCustomerInventories()) {
            pc = (PersistenceCapable) c;
            assertTrue(pc.pcIsDetached());
            pc = (PersistenceCapable) c.getItem();
            assertTrue(pc.pcIsDetached());

        }
    }
}
View Full Code Here

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

        TransferFieldManager fm = new TransferFieldManager();
        for (StateManagerImpl sm : states) {
            ClassMetaData cmd = sm.getMetaData();
            if (sm.isPersistent() && cmd.isDetachable()) {
                PersistenceCapable pc = sm.getPersistenceCapable();
                if(pc.pcIsDetached() == false){
                    // Detach proxy fields.
                    BitSet loaded = sm.getLoaded();
                    for (FieldMetaData fmd : cmd.getProxyFields()) {
                        if (loaded.get(fmd.getIndex())) {
                            detachProxyField(fmd, pc, sm, fm);
View Full Code Here

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

                sm.getOwner().dirty(sm.getOwnerIndex());
                _cache.persist(sm);
                pc = sm.getPersistenceCapable();
            } else {
                pc = assertPersistenceCapable(obj);
                if (pc.pcIsDetached() == Boolean.TRUE)
                    throw new ObjectExistsException(_loc.get
                        ("persist-detached", Exceptions.toString(obj))).
                        setFailedObject(obj);
            }
View Full Code Here

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

    public boolean isDetached(Object obj) {
        if (!(ImplHelper.isManageable(obj)))
            return false;

        PersistenceCapable pc = ImplHelper.toPersistenceCapable(obj, _conf);
        Boolean detached = pc.pcIsDetached();
        if (detached != null)
            return detached.booleanValue();

        // last resort: instance is detached if it has a store record
        ClassMetaData meta = _conf.getMetaDataRepositoryInstance().
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.