Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOObjectStore


     * Returns the object store for the current thread (or requests one and sets it if there isn't one).
     *
     * @return the object store for the current thread
     */
    protected EOObjectStore currentThreadObjectStore() {
      EOObjectStore os = (EOObjectStore) ERXThreadStorage.valueForKey(ERXObjectStoreCoordinatorPool.THREAD_OSC_KEY);
      if (os == null) {
        os = nextObjectStore();
        if (os != null) {
          ERXThreadStorage.takeValueForKey(os, ERXObjectStoreCoordinatorPool.THREAD_OSC_KEY);
        }
View Full Code Here


                _initObjectStores();
            }
            if (_currentObjectStoreIndex == _maxObjectStoreCoordinators) {
                _currentObjectStoreIndex = 0;
            }
            EOObjectStore os = _objectStores.get(_currentObjectStoreIndex++);
          return os;
        }
    }
View Full Code Here

    }

    @Override
    public void initializeObject(final EOEnterpriseObject anEnterpriseObject, final EOGlobalID aGlobalId, final EOEditingContext anEditingContext) {
        if (((MockEditingContext)anEditingContext).entityNamesToGetFromDatabase.containsObject(anEnterpriseObject.entityName())) {
            EOObjectStore rootObjectStore = anEditingContext.rootObjectStore();
            rootObjectStore.lock();
            try {
                rootObjectStore.initializeObject(anEnterpriseObject, aGlobalId, anEditingContext);
            } finally {
                rootObjectStore.unlock();
            }
        }
    }
View Full Code Here

    /*
     * Check to see if this context, or any parent context, is saving changes.
     * If so, queue up the notifications.
     */
    boolean isSavingChanges = savingChanges;
    EOObjectStore parent = parentObjectStore();
    while(!isSavingChanges && parent instanceof ERXEC) {
      ERXEC parentEc = (ERXEC) parent;
      isSavingChanges = parentEc.savingChanges;
      parent = parentEc.parentObjectStore();
    }
View Full Code Here

     * @param parent  The parent EOObjectStore for the editing context created and returned by this method
     * @return       The editing context created by this method
     */
    protected EOEditingContext _createEditingContext(EOObjectStore parent) {
     
      EOObjectStore arg = (parent == null ? EOEditingContext.defaultParentObjectStore() : parent);
      EOEditingContext editingContext;
     
      try {
        editingContext = (EOEditingContext) editingContextConstructor().newInstance(arg);
      }
View Full Code Here

    assertNotNull(ERXObjectStoreCoordinatorPool._pool());
    assertNotNull(ERXObjectStoreCoordinatorPool._pool().nextObjectStore());
  }
 
  public void testDifferenceStores() {
    EOObjectStore osc1 = ERXObjectStoreCoordinatorPool._pool().nextObjectStore();
    EOObjectStore osc2 = ERXObjectStoreCoordinatorPool._pool().nextObjectStore();
    assertNotSame(osc1, osc2);
  }
View Full Code Here

TOP

Related Classes of com.webobjects.eocontrol.EOObjectStore

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.