Package org.jpox

Examples of org.jpox.StateManager


            if (listener.forClass(pc.getClass()) && listener.getListener() instanceof StoreLifecycleListener)
            {
                ObjectManager om = ObjectManagerHelper.getObjectManager((PersistenceCapable)pc);
                String[] fieldNames = null;
                // PRE_STORE will return the fields being stored (JPOX extension)
                StateManager sm = om.findStateManager(pc);
                fieldNames = sm.getDirtyFieldNames();
                if (fieldNames == null)
                {
                    // Must be persisting so just return all loaded fields
                    fieldNames = sm.getLoadedFieldNames();
                }
                ((StoreLifecycleListener)listener.getListener()).preStore(new FieldInstanceLifecycleEvent(pc, InstanceLifecycleEvent.STORE, null, fieldNames));
            }
        }
View Full Code Here


                    Map.Entry entry = (Map.Entry)iter.next();
                    Object key = entry.getKey();
                    Object value = entry.getValue();
                    if (fmd.getMap().getKeyClassMetaData() != null)
                    {
                        StateManager objSM = om.findStateManager(key);
                        if (objSM == null)
                        {
                            objSM = StateManagerFactory.newStateManagerForEmbedded(om, key, false);
                            objSM.addEmbeddedOwner(ownerSM, fieldNumber);
                        }
                    }
                    if (fmd.getMap().getValueClassMetaData() != null)
                    {
                        StateManager objSM = om.findStateManager(value);
                        if (objSM == null)
                        {
                            objSM = StateManagerFactory.newStateManagerForEmbedded(om, value, false);
                            objSM.addEmbeddedOwner(ownerSM, fieldNumber);
                        }
                    }
                }
            }
View Full Code Here

                ObjectManager om = ownerSM.getObjectManager();
                Iterator iter = c.iterator();
                while (iter.hasNext())
                {
                    Object pc = iter.next();
                    StateManager objSM = om.findStateManager(pc);
                    if (objSM == null)
                    {
                        objSM = StateManagerFactory.newStateManagerForEmbedded(om, pc, false);
                        objSM.addEmbeddedOwner(ownerSM, fieldNumber);
                    }
                }
            }

            if (backingStore != null && useCache && !isCacheLoaded)
View Full Code Here

                    Map.Entry entry = (Map.Entry)iter.next();
                    Object key = entry.getKey();
                    Object value = entry.getValue();
                    if (fmd.getMap().getKeyClassMetaData() != null)
                    {
                        StateManager objSM = om.findStateManager(key);
                        if (objSM == null)
                        {
                            objSM = StateManagerFactory.newStateManagerForEmbedded(om, key, false);
                            objSM.addEmbeddedOwner(ownerSM, fieldNumber);
                        }
                    }
                    if (fmd.getMap().getValueClassMetaData() != null)
                    {
                        StateManager objSM = om.findStateManager(value);
                        if (objSM == null)
                        {
                            objSM = StateManagerFactory.newStateManagerForEmbedded(om, value, false);
                            objSM.addEmbeddedOwner(ownerSM, fieldNumber);
                        }
                    }
                }
            }
View Full Code Here

     * @param pc The object that is hollow that we are going to manage
     */
    public static StateManager newStateManagerForHollowPreConstructed(ObjectManager om, Object id, Object pc)
    {
        Initialization stateManagerInitialization = new Initialization(om,pc.getClass());
        StateManager sm = om.getApiAdapter().newStateManager(om, stateManagerInitialization.getClassMetaData());
        sm.initialiseForHollowPreConstructed(id, pc);
        return sm;
    }
View Full Code Here

     * @param fv the initial field values of the object.
     */
    public static StateManager newStateManagerForHollowPopulated(ObjectManager om, Class pcClass, Object id, FieldValues fv)
    {
        Initialization stateManagerInitialization = new Initialization(om,pcClass);
        StateManager sm = om.getApiAdapter().newStateManager(om, stateManagerInitialization.getClassMetaData());
        sm.initialiseForHollow(id, fv, stateManagerInitialization.getPCClass());
        return sm;
    }
View Full Code Here

     * @param pc The object that is persistent that we are going to manage
     */
    public static StateManager newStateManagerForPersistentClean(ObjectManager om, Object id, Object pc)
    {
        Initialization stateManagerInitialization = new Initialization(om,pc.getClass());
        StateManager sm = om.getApiAdapter().newStateManager(om, stateManagerInitialization.getClassMetaData());
        sm.initialiseForPersistentClean(id, pc);
        return sm;
    }
View Full Code Here

     * @param fv the initial field values of the object.
     */
    public static StateManager newStateManagerForHollowPopulatedAppId(ObjectManager om, Class pcClass, FieldValues fv)
    {
        Initialization stateManagerInitialization = new Initialization(om,pcClass);
        StateManager sm = om.getApiAdapter().newStateManager(om, stateManagerInitialization.getClassMetaData());
        sm.initialiseForHollowAppId(fv,stateManagerInitialization.getPCClass());
        return sm;
    }
View Full Code Here

     * @param copyPc Whether the SM should manage a copy of the passed PC or that one
     */
    public static StateManager newStateManagerForEmbedded(ObjectManager om, Object pc, boolean copyPc)
    {
        Initialization stateManagerInitialization = new Initialization(om,pc.getClass());
        StateManager sm = om.getApiAdapter().newStateManager(om, stateManagerInitialization.getClassMetaData());
        sm.initialiseForEmbedded(pc, copyPc);
        return sm;
    }
View Full Code Here

     * @param preInsertChanges Any changes to make before inserting
     */
    public static StateManager newStateManagerForPersistentNew(ObjectManager om, Object pc, FieldValues preInsertChanges)
    {
        Initialization stateManagerInitialization = new Initialization(om, pc.getClass());
        StateManager sm = om.getApiAdapter().newStateManager(om, stateManagerInitialization.getClassMetaData());
        sm.initialiseForPersistentNew(pc, preInsertChanges);
        return sm;
    }
View Full Code Here

TOP

Related Classes of org.jpox.StateManager

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.