net.wotonomy.control
Class EODatabaseDataSource

java.lang.Object
  extended by net.wotonomy.control.EODatabaseDataSource

public abstract class EODatabaseDataSource
extends java.lang.Object

EODatabaseSource is a general-purpose implementation of EODataSource that is EOClassDescription-aware and that can vend appropriate EODetailDataSources.

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

Constructor Summary
EODatabaseDataSource(EOEditingContext aContext, java.lang.String anEntityName)
          Constructs a data source that fetches all objects of the specified entity type.
EODatabaseDataSource(EOEditingContext aContext, java.lang.String anEntityName, java.lang.String aFetchSpecName)
          Constructs a data source that fetches objects of the specified entity type according to the fetch specification with the specified name.
 
Method Summary
 EOQualifier auxiliaryQualifier()
          Returns the qualifier that is applied to the results fetched by the fetch specification before objects are returned by fetch objects, or null if no such qualifier has been specified.
 EOClassDescription classDescriptionForObjects()
          Returns the description of the class of the objects that is vended by this data source, or null if no entity name is specified.
 EOObjectStore databaseContext()
          Returns the object store at the root of the editing context's editing hierarchy.
 EODataSource dataSourceQualifiedByKey(java.lang.String aKey)
          Returns a detail data source that is capable of manipulating objects of the type returned by applying the specified key to objects vended by this data source.
 void deleteObject(java.lang.Object anObject)
          Deletes the specified object from this data source.
 EOEditingContext editingContext()
          Returns the editing context for this data source, or null if no editing context was specified.
 net.wotonomy.foundation.NSArray fetchObjects()
          Returns a List containing the objects of the current entity type that conform to the specified fetch specification.
 EOFetchSpecification fetchSpecification()
          Returns the fetch specification currently used by this data source to fetch objects, or null if none is specified.
 EOFetchSpecification fetchSpecificationForFetch()
          Returns a copy of the fetch specification that will be used to determine fetch for this data source.
 java.lang.String fetchSpecificationName()
          Returns the name of the current fetch specification, or null if no name has been specified.
 void insertObject(java.lang.Object anObject)
          Inserts the specified object into this data source.
 boolean isFetchEnabled()
          Returns whether fetching is currently allowed.
 net.wotonomy.foundation.NSArray qualifierBindingKeys()
          Returns a List of the union of the binding keys for the fetch spec's qualifier and the auxiliary qualifier.
 net.wotonomy.foundation.NSDictionary qualifierBindings()
          Returns a Map of the bindings that will be applied against the fetch spec's qualifier and the auxiliary qualifier, or null if no bindings exist.
 void qualifyWithRelationshipKey(java.lang.String aKey, java.lang.Object anObject)
          Restricts this data source to vend those objects that are associated with the specified key on the specified object.
 void setAuxiliaryQualifier(EOQualifier aQualifier)
          Sets the auxiliary qualifier that will be applied to objects returned from the fetch described by the fetch specification.
 void setFetchEnabled(boolean isFetchEnabled)
          Sets whether fetches are currently allowed.
 void setFetchSpecification(EOFetchSpecification aFetchSpec)
          Sets the fetch specification used by this data source.
 void setFetchSpecificationByName(java.lang.String aName)
          Sets the fetch specification used by this data source, requesting it from the class description for this data source's entity class description, if any.
 void setQualifierBindings(java.util.Map aBindingMap)
          Sets the bindings to be applied to the fetch specification and the auxiliary qualifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EODatabaseDataSource

public EODatabaseDataSource(EOEditingContext aContext,
                            java.lang.String anEntityName)
Constructs a data source that fetches all objects of the specified entity type.


EODatabaseDataSource

public EODatabaseDataSource(EOEditingContext aContext,
                            java.lang.String anEntityName,
                            java.lang.String aFetchSpecName)
Constructs a data source that fetches objects of the specified entity type according to the fetch specification with the specified name.

Method Detail

auxiliaryQualifier

public EOQualifier auxiliaryQualifier()
Returns the qualifier that is applied to the results fetched by the fetch specification before objects are returned by fetch objects, or null if no such qualifier has been specified.


classDescriptionForObjects

public EOClassDescription classDescriptionForObjects()
Returns the description of the class of the objects that is vended by this data source, or null if no entity name is specified.


databaseContext

public EOObjectStore databaseContext()
Returns the object store at the root of the editing context's editing hierarchy.


dataSourceQualifiedByKey

public EODataSource dataSourceQualifiedByKey(java.lang.String aKey)
Returns a detail data source that is capable of manipulating objects of the type returned by applying the specified key to objects vended by this data source.

See Also:
qualifyWithRelationshipKey(java.lang.String, java.lang.Object)

deleteObject

public void deleteObject(java.lang.Object anObject)
Deletes the specified object from this data source. This implementation deletes the specified object from the editing context.


editingContext

public EOEditingContext editingContext()
Returns the editing context for this data source, or null if no editing context was specified.


fetchObjects

public net.wotonomy.foundation.NSArray fetchObjects()
Returns a List containing the objects of the current entity type that conform to the specified fetch specification. If an auxiliary qualifier has been specified, that qualifier is applied to the objects before returning the result. If fetch is not enabled, this method returns null.


fetchSpecification

public EOFetchSpecification fetchSpecification()
Returns the fetch specification currently used by this data source to fetch objects, or null if none is specified. If null, this fetchObjects() will return all objects of the specified entity type.


fetchSpecificationForFetch

public EOFetchSpecification fetchSpecificationForFetch()
Returns a copy of the fetch specification that will be used to determine fetch for this data source. If this data source has an auxiliary qualifier, that qualifier will be inserted into the returned fetch specification's qualifier.


fetchSpecificationName

public java.lang.String fetchSpecificationName()
Returns the name of the current fetch specification, or null if no name has been specified.


insertObject

public void insertObject(java.lang.Object anObject)
Inserts the specified object into this data source. This implementation registers the object as an inserted object with the editing context.


isFetchEnabled

public boolean isFetchEnabled()
Returns whether fetching is currently allowed. If false, fetchObjects() will return null. Default is true.


qualifierBindingKeys

public net.wotonomy.foundation.NSArray qualifierBindingKeys()
Returns a List of the union of the binding keys for the fetch spec's qualifier and the auxiliary qualifier.


qualifierBindings

public net.wotonomy.foundation.NSDictionary qualifierBindings()
Returns a Map of the bindings that will be applied against the fetch spec's qualifier and the auxiliary qualifier, or null if no bindings exist.


qualifyWithRelationshipKey

public void qualifyWithRelationshipKey(java.lang.String aKey,
                                       java.lang.Object anObject)
Restricts this data source to vend those objects that are associated with the specified key on the specified object.


setAuxiliaryQualifier

public void setAuxiliaryQualifier(EOQualifier aQualifier)
Sets the auxiliary qualifier that will be applied to objects returned from the fetch described by the fetch specification.


setFetchEnabled

public void setFetchEnabled(boolean isFetchEnabled)
Sets whether fetches are currently allowed. If false, fetchObjects() will return null.


setFetchSpecification

public void setFetchSpecification(EOFetchSpecification aFetchSpec)
Sets the fetch specification used by this data source. If null, all objects of the specified entity type will be returned by fetchObjects().


setFetchSpecificationByName

public void setFetchSpecificationByName(java.lang.String aName)
Sets the fetch specification used by this data source, requesting it from the class description for this data source's entity class description, if any. If the name cannot be resolved, the fetch specification will be set to null.


setQualifierBindings

public void setQualifierBindings(java.util.Map aBindingMap)
Sets the bindings to be applied to the fetch specification and the auxiliary qualifier.



Copyright © 2006 null. All Rights Reserved.