|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.wotonomy.control.EOObjectStore
net.wotonomy.control.AbstractObjectStore
public abstract class AbstractObjectStore
An abstract implementation of object store that implements common functionality. Subclasses must implement data object creation, initialization, and refault logic, as well as logic to commit an editing context.
Field Summary |
---|
Fields inherited from class net.wotonomy.control.EOObjectStore |
---|
DeletedKey, InsertedKey, InvalidatedAllObjectsInStoreNotification, InvalidatedKey, ObjectsChangedInStoreNotification, UpdatedKey |
Constructor Summary | |
---|---|
AbstractObjectStore()
Constructs a new instance of this object store. |
Method Summary | |
---|---|
net.wotonomy.foundation.NSArray |
arrayFaultWithSourceGlobalID(EOGlobalID aGlobalID,
java.lang.String aRelationship,
EOEditingContext aContext)
This implementation returns an appropriately configured array fault. |
protected abstract java.util.Collection |
changedKeysForObject(java.lang.Object anObject)
Returns the keys that have changed on the specified object. |
protected java.lang.Object |
createInstanceWithEditingContext(EOGlobalID aGlobalID,
EOEditingContext aContext)
Creates a new instance of an object that corresponds to the specified global id and is registered in the specified context. |
protected abstract java.lang.Object |
deleteObject(EOGlobalID aGlobalID)
Returns the data for the row corresponding to the specified id. |
protected abstract java.lang.String |
entityForGlobalIDOrObject(EOGlobalID aGlobalID,
java.lang.Object anObject)
Returns the entity that corresponds to the specified global id and/or object. |
java.lang.Object |
faultForGlobalID(EOGlobalID aGlobalID,
EOEditingContext aContext)
This implementation returns the actual object for the specified id. |
java.lang.Object |
faultForRawRow(java.util.Map aDictionary,
java.lang.String anEntityName,
EOEditingContext aContext)
Returns a fault representing an object of the specified entity type with values from the specified dictionary. |
protected java.util.Map |
getUpdateMap(EOEditingContext aContext,
java.lang.Object anObject)
This method returns a map containing just the keys that are modified for a given object, converting any to-one or to-many relationships to id references. |
protected abstract EOGlobalID |
globalIDForData(java.util.Map aDataMap)
Extracts the global id for the fetched data or snapshot. |
void |
initializeObject(java.lang.Object anObject,
EOGlobalID aGlobalID,
EOEditingContext aContext)
Given a newly instantiated object, this method initializes its properties to values appropriate for the specified id. |
protected abstract java.util.Map |
insertObject(EOGlobalID aGlobalID,
java.util.Map aDataMap)
Returns the data for the row corresponding to the specified id. |
protected void |
invalidateAllCache()
Dumps all snapshots. |
void |
invalidateAllObjects()
Remove all values from all objects in memory, turning them into faults, and posts a notification that all objects have been invalidated. |
protected void |
invalidateObject(EOGlobalID aGlobalID)
Dumps the snapshot corresponding to the specified id. |
void |
invalidateObjectsWithGlobalIDs(java.util.List aList)
Removes values with the specified ids from memory, turning them into faults, and posts a notification that those objects have been invalidated. |
boolean |
isObjectLockedWithGlobalID(EOGlobalID aGlobalID,
EOEditingContext aContext)
Returns false because locking is not currently permitted. |
void |
lockObjectWithGlobalID(EOGlobalID aGlobalID,
EOEditingContext aContext)
Does nothing because locking is not currently permitted. |
net.wotonomy.foundation.NSArray |
objectsForSourceGlobalID(EOGlobalID aGlobalID,
java.lang.String aRelationship,
EOEditingContext aContext)
Returns a List of objects associated with the object with the specified id for the specified property relationship. |
net.wotonomy.foundation.NSArray |
objectsWithFetchSpecification(EOFetchSpecification aFetchSpec,
EOEditingContext aContext)
Returns a List of objects the meet the criteria of the supplied specification. |
protected java.lang.Object |
processInsert(EOEditingContext aContext,
java.lang.Object object)
|
protected java.util.Map |
readFromCache(EOGlobalID aGlobalID,
java.util.Collection keys)
Reads the local data snapshot for the specified id. |
protected abstract java.util.Map |
readObject(EOGlobalID aGlobalID,
java.util.Collection keys)
Returns the data for the row corresponding to the specified id containing at least the specified keys. |
void |
refaultObject(java.lang.Object anObject,
EOGlobalID aGlobalID,
EOEditingContext aContext)
Removes all values from the specified object, converting it into a fault for the specified id. |
void |
saveChangesInEditingContext(EOEditingContext aContext)
Writes all changes in the specified editing context to the respository. |
protected abstract java.lang.Comparable |
timestampForData(java.util.Map aDataMap)
Returns a comparable object (typically a Date or Long) for the given data map or snapshot. |
protected abstract java.lang.Object |
updateObject(EOGlobalID aGlobalID,
java.util.Map aDataMap)
Returns the data for the row corresponding to the specified id. |
Methods inherited from class net.wotonomy.control.EOObjectStore |
---|
editingContextDidForgetObjectWithGlobalID |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractObjectStore()
Method Detail |
---|
public net.wotonomy.foundation.NSArray arrayFaultWithSourceGlobalID(EOGlobalID aGlobalID, java.lang.String aRelationship, EOEditingContext aContext)
arrayFaultWithSourceGlobalID
in class EOObjectStore
public java.lang.Object faultForGlobalID(EOGlobalID aGlobalID, EOEditingContext aContext)
faultForGlobalID
in class EOObjectStore
public java.lang.Object faultForRawRow(java.util.Map aDictionary, java.lang.String anEntityName, EOEditingContext aContext)
faultForRawRow
in class EOObjectStore
public void initializeObject(java.lang.Object anObject, EOGlobalID aGlobalID, EOEditingContext aContext)
initializeObject
in class EOObjectStore
protected java.util.Map readFromCache(EOGlobalID aGlobalID, java.util.Collection keys)
protected abstract java.lang.Comparable timestampForData(java.util.Map aDataMap)
protected abstract EOGlobalID globalIDForData(java.util.Map aDataMap)
protected abstract java.lang.String entityForGlobalIDOrObject(EOGlobalID aGlobalID, java.lang.Object anObject)
protected abstract java.util.Collection changedKeysForObject(java.lang.Object anObject)
protected abstract java.util.Map readObject(EOGlobalID aGlobalID, java.util.Collection keys)
protected abstract java.util.Map insertObject(EOGlobalID aGlobalID, java.util.Map aDataMap)
protected abstract java.lang.Object updateObject(EOGlobalID aGlobalID, java.util.Map aDataMap)
protected abstract java.lang.Object deleteObject(EOGlobalID aGlobalID)
protected java.lang.Object createInstanceWithEditingContext(EOGlobalID aGlobalID, EOEditingContext aContext)
protected void invalidateObject(EOGlobalID aGlobalID)
protected void invalidateAllCache()
public void invalidateAllObjects()
invalidateAllObjects
in class EOObjectStore
public void invalidateObjectsWithGlobalIDs(java.util.List aList)
invalidateObjectsWithGlobalIDs
in class EOObjectStore
public boolean isObjectLockedWithGlobalID(EOGlobalID aGlobalID, EOEditingContext aContext)
isObjectLockedWithGlobalID
in class EOObjectStore
public void lockObjectWithGlobalID(EOGlobalID aGlobalID, EOEditingContext aContext)
lockObjectWithGlobalID
in class EOObjectStore
public net.wotonomy.foundation.NSArray objectsForSourceGlobalID(EOGlobalID aGlobalID, java.lang.String aRelationship, EOEditingContext aContext)
objectsForSourceGlobalID
in class EOObjectStore
public net.wotonomy.foundation.NSArray objectsWithFetchSpecification(EOFetchSpecification aFetchSpec, EOEditingContext aContext)
objectsWithFetchSpecification
in class EOObjectStore
public void refaultObject(java.lang.Object anObject, EOGlobalID aGlobalID, EOEditingContext aContext)
refaultObject
in class EOObjectStore
public void saveChangesInEditingContext(EOEditingContext aContext)
saveChangesInEditingContext
in class EOObjectStore
protected java.lang.Object processInsert(EOEditingContext aContext, java.lang.Object object)
protected java.util.Map getUpdateMap(EOEditingContext aContext, java.lang.Object anObject)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |