net.wotonomy.control
Class EditingContext

java.lang.Object
  extended by net.wotonomy.control.EOObjectStore
      extended by net.wotonomy.control.EOEditingContext
          extended by net.wotonomy.control.EditingContext
All Implemented Interfaces:
EOObserving

public class EditingContext
extends EOEditingContext

EditingContext provides transactional support for fetching, editing, and committing changes made on a collection of objects to a parent object store. This subclasses EOEditingContext to provide java-friendly conveniences.

Version:
$Revision: 894 $
Author:
michael@mpowers.net, $Author: cgruber $

Nested Class Summary
 
Nested classes/interfaces inherited from class net.wotonomy.control.EOEditingContext
EOEditingContext.Delegate, EOEditingContext.Editor, EOEditingContext.MessageHandler
 
Field Summary
 
Fields inherited from class net.wotonomy.control.EOEditingContext
EditingContextDidSaveChangesNotification, EditingContextFlushChangesRunLoopOrdering, MessageChangeConflict, ObjectsChangedInEditingContextNotification
 
Fields inherited from class net.wotonomy.control.EOObjectStore
DeletedKey, InsertedKey, InvalidatedAllObjectsInStoreNotification, InvalidatedKey, ObjectsChangedInStoreNotification, UpdatedKey
 
Constructor Summary
EditingContext()
          Default constructor creates a new editing context that uses the default object store.
EditingContext(EOObjectStore anObjectStore)
          Creates a new editing context that uses the specified object store as its parent object store.
 
Method Summary
 java.util.List geRegisteredObjects()
          Returns a List of all objects registered in this editing context.
 java.util.List getArrayFaultWithSourceGlobalID(EOGlobalID aGlobalID, java.lang.String aRelationshipKey, EOEditingContext aContext)
          Returns a List of objects associated with the object with the specified id for the specified property relationship, or may return a placeholder array that will defer the fetch until needed (aka an array fault).
 java.util.Map getCommittedSnapshotForObject(java.lang.Object anObject)
          Returns a snapshot of the specified object as it existed when it was last read or committed to the parent object store.
 java.util.Map getCurrentEventSnapshotForObject(java.lang.Object anObject)
          Returns a snapshot of the specified object as it existed before the edits triggered by the current event loop were processed.
static double getDefaultFetchTimestampLag()
           
static EOObjectStore getDefaultParentObjectStore()
          Returns the default parent object store for all object stores created with the parameterless constructor.
 java.lang.Object getDelegate()
          Returns the delegate for this editing context, or null if no delegate has been set.
 java.util.List getDeletedObjects()
          Returns a List of all objects marked as deleted in this editing context.
 java.util.List getEditors()
          Returns a List of registered editors of this editing context.
 java.lang.Object getFaultForGlobalID(EOGlobalID aGlobalID)
          Returns the object for the specified id.
 java.lang.Object getFaultForRawRow(java.util.Map aDictionary, java.lang.String anEntityName)
          Returns a fault representing an object of the specified entity type with values from the specified dictionary.
 double getFetchTimestamp()
          Returns the fetch timestamp for this editing context.
 EOGlobalID getGlobalIDForObject(java.lang.Object anObject)
          Returns the id for the specified object, or null if the object is not registered in this context.
 java.util.List getInsertedObjects()
          Returns a List of the objects that have been inserted into this editing context.
 java.lang.Object getMessageHandler()
          Returns the message handler for this editing context, or null if no message handler has been set.
 java.lang.Object getObjectForGlobalID(EOGlobalID aGlobalID)
          Returns the object registered in this editing context for the specified id, or null if that id is not registered.
 java.util.List getObjectsWithFetchSpecification(EOFetchSpecification aFetchSpec)
          Returns a List of objects the meet the criteria of the supplied specification.
 EOObjectStore getParentObjectStore()
          Returns the parent object store for this editing context.
 EOObjectStore getRootObjectStore()
          Returns the root object store, which is the parent of all parent object stores of this editing context.
 java.util.List getUpdatedObjects()
          Returns a list of all objects marked as modified, but not inserted or deleted, in this editing context.
 
Methods inherited from class net.wotonomy.control.EOEditingContext
addEditor, arrayFaultWithSourceGlobalID, committedSnapshotForObject, currentEventSnapshotForObject, defaultFetchTimestampLag, defaultParentObjectStore, delegate, deletedObjects, deleteObject, editingContextDidForgetObjectWithGlobalID, editors, faultForGlobalID, faultForRawRow, faultForRawRow, fetchTimestamp, flushRecentChanges, forgetObject, globalIDForObject, handleNotification, hasChanges, initializeObject, insertedObjects, insertObject, insertObjectWithGlobalID, instancesRetainRegisteredObjects, invalidateAllObjects, invalidateObjectsWithGlobalIDs, isObjectLockedWithGlobalID, lockObject, lockObjectWithGlobalID, locksObjectsBeforeFirstModification, messageHandler, objectForGlobalID, objectsForSourceGlobalID, objectsWithFetchSpecification, objectsWithFetchSpecification, objectWillChange, parentObjectStore, processRecentChanges, propagatesDeletesAtEndOfEvent, recordObject, redo, refault, refaultObject, refaultObjects, refetch, registeredObjects, removeEditor, reset, revert, rootObjectStore, saveChanges, saveChangesInEditingContext, setDefaultFetchTimestampLag, setDefaultParentObjectStore, setDelegate, setFetchTimestamp, setInstancesRetainRegisteredObjects, setLocksObjectsBeforeFirstModification, setMessageHandler, setPropagatesDeletesAtEndOfEvent, setStopsValidationAfterFirstError, stopsValidationAfterFirstError, toString, undo, updatedObjects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EditingContext

public EditingContext()
Default constructor creates a new editing context that uses the default object store. If the default object store has not been set, an exception is thrown.


EditingContext

public EditingContext(EOObjectStore anObjectStore)
Creates a new editing context that uses the specified object store as its parent object store.

Method Detail

getArrayFaultWithSourceGlobalID

public java.util.List getArrayFaultWithSourceGlobalID(EOGlobalID aGlobalID,
                                                      java.lang.String aRelationshipKey,
                                                      EOEditingContext aContext)
Returns a List of objects associated with the object with the specified id for the specified property relationship, or may return a placeholder array that will defer the fetch until needed (aka an array fault). All objects must be registered in the specified editing context. This implementation calls to its parent object store's implementation if the requested source object is not registered in this editing context. The specified relationship key must produce a result of type Collection for the source object or an exception is thrown.


getCommittedSnapshotForObject

public java.util.Map getCommittedSnapshotForObject(java.lang.Object anObject)
Returns a snapshot of the specified object as it existed when it was last read or committed to the parent object store.


getCurrentEventSnapshotForObject

public java.util.Map getCurrentEventSnapshotForObject(java.lang.Object anObject)
Returns a snapshot of the specified object as it existed before the edits triggered by the current event loop were processed.


getDelegate

public java.lang.Object getDelegate()
Returns the delegate for this editing context, or null if no delegate has been set.


getDeletedObjects

public java.util.List getDeletedObjects()
Returns a List of all objects marked as deleted in this editing context.


getEditors

public java.util.List getEditors()
Returns a List of registered editors of this editing context.


getFaultForGlobalID

public java.lang.Object getFaultForGlobalID(EOGlobalID aGlobalID)
Returns the object for the specified id. If the object's data has not been fetched, it will be fetched when needed.


getFaultForRawRow

public java.lang.Object getFaultForRawRow(java.util.Map aDictionary,
                                          java.lang.String anEntityName)
Returns a fault representing an object of the specified entity type with values from the specified dictionary.


getFetchTimestamp

public double getFetchTimestamp()
Returns the fetch timestamp for this editing context.


getGlobalIDForObject

public EOGlobalID getGlobalIDForObject(java.lang.Object anObject)
Returns the id for the specified object, or null if the object is not registered in this context.


getInsertedObjects

public java.util.List getInsertedObjects()
Returns a List of the objects that have been inserted into this editing context.


getMessageHandler

public java.lang.Object getMessageHandler()
Returns the message handler for this editing context, or null if no message handler has been set.


getObjectForGlobalID

public java.lang.Object getObjectForGlobalID(EOGlobalID aGlobalID)
Returns the object registered in this editing context for the specified id, or null if that id is not registered.


getObjectsWithFetchSpecification

public java.util.List getObjectsWithFetchSpecification(EOFetchSpecification aFetchSpec)
Returns a List of objects the meet the criteria of the supplied specification.


getParentObjectStore

public EOObjectStore getParentObjectStore()
Returns the parent object store for this editing context. The result will not be null.


geRegisteredObjects

public java.util.List geRegisteredObjects()
Returns a List of all objects registered in this editing context.


getRootObjectStore

public EOObjectStore getRootObjectStore()
Returns the root object store, which is the parent of all parent object stores of this editing context.


getUpdatedObjects

public java.util.List getUpdatedObjects()
Returns a list of all objects marked as modified, but not inserted or deleted, in this editing context.


getDefaultFetchTimestampLag

public static double getDefaultFetchTimestampLag()

getDefaultParentObjectStore

public static EOObjectStore getDefaultParentObjectStore()
Returns the default parent object store for all object stores created with the parameterless constructor.



Copyright © 2006 null. All Rights Reserved.