Examples of PersistenceCapable


Examples of org.apache.openjpa.enhance.PersistenceCapable

     */
    public boolean isDetached(Object obj, boolean find) {
        if (!(ImplHelper.isManageable(obj)))
            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

     * object is managed by another broker
     */
    protected StateManagerImpl getStateManagerImpl(Object obj,
        boolean assertThisContext) {
        if (ImplHelper.isManageable(obj)) {
            PersistenceCapable pc = ImplHelper.toPersistenceCapable(obj, _conf);
            BrokerImpl pcBroker = (BrokerImpl)pc.pcGetGenericContext();
            if (pcBroker == this || isFromWriteBehindCallback())
                return (StateManagerImpl) pc.pcGetStateManager();
            if (assertThisContext && pcBroker != null)
                throw new UserException(_loc.get("not-managed",
                    Exceptions.toString(obj))).setFailedObject(obj);
        }
        return null;
View Full Code Here

Examples of org.apache.openjpa.enhance.PersistenceCapable

    }

    private void assertDetachedSM(Object obj) {
        OpenJPAEntityManager pm = getPM();
        assertTrue(pm.isDetached(obj));
        PersistenceCapable pc = (PersistenceCapable) obj;
        assertEquals(DetachedStateManager.class,
            pc.pcGetStateManager().getClass());
        endEm(pm);
    }
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.