Examples of pcIsDetached()


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

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

        // last resort: instance is detached if it has a store record
        ClassMetaData meta = _repo.getMetaData(ImplHelper.getManagedInstance(pc).getClass(), _loader, true);
View Full Code Here

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

       
        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, _tsm);
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
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.