Package com.sun.jdo.spi.persistence.support.sqlstore

Examples of com.sun.jdo.spi.persistence.support.sqlstore.PersistenceCapable


        assertActiveTransaction(false);
        if (!(pc instanceof PersistenceCapable)) {
            return pc;
        }

        PersistenceCapable mypc = (PersistenceCapable) pc;

        // The PC.jdoGetPersistenceManager() returns PersistenceManagerWrapper:
        PersistenceManagerWrapper pmw = (PersistenceManagerWrapper) mypc.jdoGetPersistenceManager();
        PersistenceManagerImpl pm = (PersistenceManagerImpl) pmw.getPersistenceManager();

        if (pm == null || pm == this) {
            return pc;
        }

        return getObjectById(pm.internalGetObjectId(mypc.jdoGetStateManager()));
    }
View Full Code Here


    }


    public void setField(Object o, int fieldNumber, Object value) {
        if (o instanceof PersistenceCapable) {
            PersistenceCapable pc = (PersistenceCapable) o;
            pc.jdoSetField(fieldNumber, value);
        }

        //RESOLVE: Otherwise, should throw an exception.
    }
View Full Code Here

        if (owner instanceof PersistenceCapable) {
            acquireShareLock();

            try {
                // Assign this SCO Collection to owner as reference
                PersistenceCapable pc = (PersistenceCapable) owner;
                StateManager sm = pc.jdoGetStateManager();

                if (obj instanceof SCOCollection) {
                    acquireFieldUpdateLock();
                    try {
                        sm.replaceObjectField(fieldName, obj);
View Full Code Here

            //verbose("create new instance by jdo constructor ...");
            final Object[] args = new Object[]{null};
            final Object instance = ctor.newInstance(args);

            //verbose("cast instance to PersistenceCapable ...");
            PersistenceCapable pc = (PersistenceCapable)instance;

            //verbose("check jdoStateManager ...");
            if (pc.jdoGetStateManager() != null) {
                println("!!! ERROR: invokation of JDO constructor:");
                println("    pc.jdoStateManager != null");
                println("!!! failed testing JDO constructor");
                return ERROR;
            }

            //verbose("check jdoFlags ...");
            if (pc.jdoGetFlags() != 1) {
                println("!!! ERROR: invokation of JDO constructor:");
                println("    pc.jdoFlags != 0");
                println("!!! failed testing JDO constructor");
                return ERROR;
            }
View Full Code Here

            //verbose("create new instance by jdo constructor ...");
            final Object[] args = new Object[]{null};
            final Object instance = ctor.newInstance(args);

            //verbose("cast instance to PersistenceCapable ...");
            PersistenceCapable pc = (PersistenceCapable)instance;

            //verbose("check jdoStateManager ...");
            if (pc.jdoGetStateManager() != null) {
                println("!!! ERROR: invokation of JDO constructor:");
                println("    pc.jdoStateManager != null");
                println("!!! failed testing JDO constructor");
                return ERROR;
            }

            //verbose("check jdoFlags ...");
            if (pc.jdoGetFlags() != 1) {
                println("!!! ERROR: invokation of JDO constructor:");
                println("    pc.jdoFlags != 0");
                println("!!! failed testing JDO constructor");
                return ERROR;
            }
View Full Code Here

    {
        Object value = null;
        FieldInfo fieldInfo = classType.getFieldInfo(fieldName);
        if (classType.isPersistenceCapable())
        {
            PersistenceCapable pc = (PersistenceCapable)object;
            int index = fieldInfo.getFieldNumber();
            StateManager stateManager = pc.jdoGetStateManager();
           
            if (stateManager != null)
            {
                // call stateManager.prepareGetField to allow the stateManager
                // to mediate the field access
                stateManager.prepareGetField(index);
            }
            value = pc.jdoGetField(index);
        }
        else
        {
            // non persistence capable class => use reflection
            try
View Full Code Here

        assertActiveTransaction(false);
        if (!(pc instanceof PersistenceCapable)) {
            return pc;
        }

        PersistenceCapable mypc = (PersistenceCapable) pc;

        // The PC.jdoGetPersistenceManager() returns PersistenceManagerWrapper:
        PersistenceManagerWrapper pmw = (PersistenceManagerWrapper) mypc.jdoGetPersistenceManager();
        PersistenceManagerImpl pm = (PersistenceManagerImpl) pmw.getPersistenceManager();

        if (pm == null || pm == this) {
            return pc;
        }

        return getObjectById(pm.internalGetObjectId(mypc.jdoGetStateManager()));
    }
View Full Code Here

    }


    public void setField(Object o, int fieldNumber, Object value) {
        if (o instanceof PersistenceCapable) {
            PersistenceCapable pc = (PersistenceCapable) o;
            pc.jdoSetField(fieldNumber, value);
        }

        //RESOLVE: Otherwise, should throw an exception.
    }
View Full Code Here

        if (owner instanceof PersistenceCapable) {
            acquireShareLock();

            try {
                // Assign this SCO Collection to owner as reference
                PersistenceCapable pc = (PersistenceCapable) owner;
                StateManager sm = pc.jdoGetStateManager();

                if (obj instanceof SCOCollection) {
                    acquireFieldUpdateLock();
                    try {
                        sm.replaceObjectField(fieldName, obj);
View Full Code Here

TOP

Related Classes of com.sun.jdo.spi.persistence.support.sqlstore.PersistenceCapable

Copyright © 2018 www.massapicom. 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.