Examples of pcGetGenericContext()


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

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

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

        boolean assertThisContext) {
        if (ImplHelper.isManageable(obj)) {
            PersistenceCapable pc = ImplHelper.toPersistenceCapable(obj, _conf);
            if (pc.pcGetGenericContext() == this)
                return (StateManagerImpl) pc.pcGetStateManager();
            if (assertThisContext && pc.pcGetGenericContext() != 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.pcGetGenericContext()

        if (emf == null || !emf.isOpen() || !ImplHelper.isManageable(entity)) {
            return false;
        }
        // Assert the context is a broker
        PersistenceCapable pc = (PersistenceCapable)entity;
        if (!(pc.pcGetGenericContext() instanceof Broker)) {
            return false;
        }
        // Assert the broker is available and open
        Broker broker = (Broker)pc.pcGetGenericContext();
        if (broker == null || broker.isClosed()) {
View Full Code Here

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

        PersistenceCapable pc = (PersistenceCapable)entity;
        if (!(pc.pcGetGenericContext() instanceof Broker)) {
            return false;
        }
        // Assert the broker is available and open
        Broker broker = (Broker)pc.pcGetGenericContext();
        if (broker == null || broker.isClosed()) {
            return false;
        }
        // Assert the emf associated with the PC is the same as the provided emf
        OpenJPAEntityManagerFactory eemf = JPAFacadeHelper.toEntityManagerFactory(broker.getBrokerFactory());
View Full Code Here

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

     */
    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);
View Full Code Here

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

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

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

        boolean assertThisContext) {
        if (ImplHelper.isManageable(obj)) {
            PersistenceCapable pc = ImplHelper.toPersistenceCapable(obj, _conf);
            if (pc.pcGetGenericContext() == this)
                return (StateManagerImpl) pc.pcGetStateManager();
            if (assertThisContext && pc.pcGetGenericContext() != 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.pcGetGenericContext()

        try {
            if (ImplHelper.isManageable(o)) {
                PersistenceCapable pc = ImplHelper.toPersistenceCapable(o, null);
                if (pc != null)
                    return JPAFacadeHelper.toEntityManager(
                        (Broker) pc.pcGetGenericContext());
            }
            return null;
        } catch (Exception e) {
            throw PersistenceExceptions.toPersistenceException(e);
        }
View Full Code Here

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

     */
    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);
View Full Code Here

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

     */
    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);
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.