ERXEnterpriseObject Interface Reference

Inherits com::webobjects::eocontrol::EOEnterpriseObject.

Inherited by ERXCustomObject, and ERXGenericRecord.

Collaboration diagram for ERXEnterpriseObject:

Collaboration graph
[legend]

List of all members.

Classes

class  Observer
class  Processor

Public Member Functions

abstract boolean _setUpdateInverseRelationships (boolean newValue)
abstract void addObjectsToBothSidesOfRelationshipWithKey (NSArray objects, String key)
abstract void batchCheckConsistency () throws NSValidation.ValidationException
abstract NSDictionary changesFromCommittedSnapshot ()
abstract void checkConsistency () throws NSValidation.ValidationException
abstract Object committedSnapshotValueForKey (String key)
abstract String description ()
abstract void didDelete (EOEditingContext ec)
abstract void didInsert ()
abstract void didRevert (EOEditingContext ec)
abstract void didUpdate ()
abstract String encryptedPrimaryKey ()
abstract void flushCaches ()
abstract Object foreignKeyForRelationshipWithKey (String rel)
abstract Logger getClassLog ()
abstract boolean isDeletedEO ()
abstract boolean isNewObject ()
abstract EOEnterpriseObject localInstanceIn (EOEditingContext ec)
abstract EOEnterpriseObject localInstanceOf (EOEnterpriseObject eo)
abstract NSArray localInstancesOf (NSArray eos)
abstract void mightDelete ()
abstract boolean parentObjectStoreIsObjectStoreCoordinator ()
abstract String primaryKey ()
abstract NSArray primaryKeyAttributeNames ()
abstract String primaryKeyInTransaction ()
abstract Object rawPrimaryKey ()
abstract Object rawPrimaryKeyInTransaction ()
abstract ERXEnterpriseObject refetchObjectFromDBinEditingContext (EOEditingContext ec)
abstract void removeObjectsFromBothSidesOfRelationshipWithKey (NSArray objects, String key)
abstract void removeObjectsFromPropertyWithKey (NSArray objects, String key)
abstract ERXEnterpriseObject self ()
abstract String toLongString ()
abstract void trimSpaces ()
abstract void willDelete () throws NSValidation.ValidationException
abstract void willInsert ()
abstract void willRevert ()
abstract void willUpdate ()

Static Public Attributes

static final boolean applyRestrictingQualifierOnInsert = ERXProperties.booleanForKey("er.extensions.ERXEnterpriseObject.applyRestrictingQualifierOnInsert")
static Processor DidDeleteProcessor
static Processor DidInsertProcessor
static Processor DidRevertProcessor
static Processor DidUpdateProcessor
static Processor FlushCachesProcessor
static final Logger insertionTrackingLog
static final String KEY_MARKER = "** KEY_MARKER **"
static final Logger log
static final Logger logMod = Logger.getLogger("er.transaction.delegate.EREditingContextDelegate.modifiedObjects")
static final Logger tranLogDidDelete
static final Logger tranLogDidInsert
static final Logger tranLogDidRevert
static final Logger tranLogDidUpdate
static final Logger tranLogMightDelete
static final Logger tranLogWillDelete
static final Logger tranLogWillInsert
static final Logger tranLogWillRevert
static final Logger tranLogWillUpdate
static final Logger validation
static final Logger validationException
static Processor WillDeleteProcessor
static Processor WillInsertProcessor
static Processor WillRevertProcessor
static Processor WillUpdateProcessor


Member Function Documentation

abstract boolean _setUpdateInverseRelationships ( boolean  newValue  )  [pure virtual]

Toggles whether or not inverse relationships should be updates. This is called by ERXGenericRecord.InverseRelationshipUpdater to prevent infinite loops and should not be called by anything else unless you know exactly what you are doing.

Parameters:
newValue whether or not inverse relationships should be updated
Returns:
the previous setting of the updateInverseRelationships setting

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract void addObjectsToBothSidesOfRelationshipWithKey ( NSArray  objects,
String  key 
) [pure virtual]

Adds a collection of objects to a given relationship by calling addObjectToBothSidesOfRelationshipWithKey for all objects in the collection.

Parameters:
objects objects to add to both sides of the given relationship
key relationship key

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract void batchCheckConsistency (  )  throws NSValidation.ValidationException [pure virtual]

This method is very similar to the checkConsistency method except that this method is only called from an outside process, usually a batch process, to verify that the data this object holds is consistent. JUnit tests are great for testing that all of the methods of a single object function correctly, batch checking of consistency is a good way of checking that all of the data in a given database is consistent. Hopefully in the future we will add a batch check consistency application to demonstrate the use of this method.

Exceptions:
NSValidation.ValidationException if the object fails consistency

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract NSDictionary changesFromCommittedSnapshot (  )  [pure virtual]

Computes the current set of changes that this object has from the currently committed snapshot.

Returns:
a dictionary holding the changed values from the currently committed snapshot.

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract void checkConsistency (  )  throws NSValidation.ValidationException [pure virtual]

Debugging method that will be called on an object before it is saved to the database if the property key: ERDebuggingEnabled is enabled. This allows for adding in a bunch of expensive validation checks that should only be enabled in development and testing environments.

Exceptions:
NSValidation.ValidationException if the object is not consistent

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract Object committedSnapshotValueForKey ( String  key  )  [pure virtual]

Determines what the value of the given key is in the committed snapshot

Parameters:
key to be checked in committed snapshot
Returns:
the committed snapshot value for the given key

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract String description (  )  [pure virtual]

Cover method to return toString.

Returns:
the results of calling toString.

Implemented in _Forum, ERXCustomObject, and ERXGenericRecord.

abstract void didDelete ( EOEditingContext  ec  )  [pure virtual]

Called on the object after is has been deleted. The editing context is passed to the object since by this point the editingContext of the object is null. You should check if the ec is a child context when doing something here that can't be undone.

Parameters:
ec editing context that used to be associated with the object.

Implemented in ERAttachment, ERXCustomObject, ERXGenericRecord, ERXPartialGenericRecord, and ERIFile.

abstract void didInsert (  )  [pure virtual]

Called on the object after is has successfully been inserted into the database.

Implemented in ERAttachment, ERS3Attachment, ERXCustomObject, ERXGenericRecord, ERXPartialGenericRecord, and ERIFile.

abstract void didRevert ( EOEditingContext  ec  )  [pure virtual]

Called on the object after it has been reverted. The editing context is passed to the object because if the object was in the insertedObjects list before the revert, the object has had its editingContext nulled.

Default implementation calls flushCaches.

Parameters:
ec editing context that is either currently associated with the object if the object was marked as changed or deleted before the revert, otherwise the editing context that was associated with the object before the revert.

Implemented in ERXCustomObject, ERXGenericRecord, and ERXPartialGenericRecord.

abstract void didUpdate (  )  [pure virtual]

Called on the object after is has successfully been updated in the database.

Implemented in Bug, ERXCustomObject, ERXGenericRecord, ERXPartialGenericRecord, and ERIFile.

abstract String encryptedPrimaryKey (  )  [pure virtual]

Takes the primary key of the object and encrypts it with the blowfish cipher using ERXCrypto.

Returns:
blowfish encrypted primary key

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract void flushCaches (  )  [pure virtual]

This is called when an object has had changes merged into it by the editing context. This is called by ERXDefaultEditingContextDelegate after it merges changes. Any caches that an object keeps based on any of it's values it should flush. The default implementation of this method does nothing.

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract Object foreignKeyForRelationshipWithKey ( String  rel  )  [pure virtual]

Returns the foreign key for a given relationship.

Parameters:
rel relationship key
Returns:
foreign key for a given relationship.

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract Logger getClassLog (  )  [pure virtual]

This methods checks if we already have created an Logger for this class If not, one will be created, stored and returned on next request. This method eliminates individual static variables for Logger's in all subclasses. We use an NSDictionary here because static fields are class specific and thus something like lazy initialization would not work in this case.

Returns:
an Logger for this objects class

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract boolean isDeletedEO (  )  [pure virtual]

Determines if this object is a deleted object by checking to see if it is included in the deletedObjects array of the editing context or - if it's editing context is null - it already has a global id.

Returns:
if the object is a deleted object

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract boolean isNewObject (  )  [pure virtual]

Determines if this object is a new object and hasn't been saved to the database yet. This method just calls the method ERExtensions.isNewObject passing in this object as the current parameter. Note that an object that has been successfully deleted will also look as if it is a new object because it will have a null editing context.

Returns:
if the object is a new enterprise object.

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract EOEnterpriseObject localInstanceIn ( EOEditingContext  ec  )  [pure virtual]

abstract EOEnterpriseObject localInstanceOf ( EOEnterpriseObject  eo  )  [pure virtual]

Returns an EO in the same editing context as the caller.

Returns:
an EO in the same editing context as the caller.

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract NSArray localInstancesOf ( NSArray  eos  )  [pure virtual]

Returns an array of EOs in the same editing context as the caller.

Returns:
array of EOs in the same editing context as the caller.

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract void mightDelete (  )  [pure virtual]

Called as part of the augmented transaction process. This method is called when deleteObject() is called on the editing context. The benefit over willDelete() is that in this method, the relationships are still intact. Mostly, at least, as it's also called when the deletes cascade.

Implemented in ERXCustomObject, ERXGenericRecord, and ERXPartialGenericRecord.

abstract boolean parentObjectStoreIsObjectStoreCoordinator (  )  [pure virtual]

Simple method that will return if the parent object store of this object's editing context is an instance of EOObjectStoreCoordinator. The reason this is important is because if this condition evaluates to true then when changes are saved in this editing context they will be propagated to the database.

Returns:
if the parent object store of this object's editing context is an EOObjectStoreCoordinator.

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract String primaryKey (  )  [pure virtual]

Primary key of the object as a String.

Returns:
primary key for the given object as a String

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract NSArray primaryKeyAttributeNames (  )  [pure virtual]

Returns the names of all primary key attributes.

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract String primaryKeyInTransaction (  )  [pure virtual]

Calling this method will return the primary key of the given enterprise object or if one has not been assigned to it yet, then it will have the adaptor channel generate one for it, cache it and then use that primary key when it is saved to the database. This method returns the string representation of the primary key. If you just want the primary key of the object or null if it doesn't have one yet, use the method primaryKey.

Returns:
string representation of the primary key of this object.

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract Object rawPrimaryKey (  )  [pure virtual]

Gives the raw primary key of the object. This could be anything from an NSData to a BigDecimal.

Returns:
the raw primary key of this object.

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract Object rawPrimaryKeyInTransaction (  )  [pure virtual]

Calling this method will return the primary key of the given enterprise object or if one has not been assigned to it yet, then it will have the adaptor channel generate one for it, cache it and then use that primary key when it is saved to the database. If you just want the primary key of the object or null if it doesn't have one yet, use the method rawPrimaryKey.

Returns:
the primary key of this object.

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract ERXEnterpriseObject refetchObjectFromDBinEditingContext ( EOEditingContext  ec  )  [pure virtual]

Method that will make sure to fetch an eo from the Database and place it in the editingContext provided as an argument

Parameters:
ec the editing context in which the result will be placed
Returns:
fresh instance of an EO fetched from the DB and placed in the editing context argument

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract void removeObjectsFromBothSidesOfRelationshipWithKey ( NSArray  objects,
String  key 
) [pure virtual]

Removes a collection of objects to a given relationship by calling removeObjectFromBothSidesOfRelationshipWithKey for all objects in the collection.

Parameters:
objects objects to be removed from both sides of the given relationship
key relationship key

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract void removeObjectsFromPropertyWithKey ( NSArray  objects,
String  key 
) [pure virtual]

Removes a collection of objects to a given relationship by calling removeObjectFromPropertyWithKey for all objects in the collection.

Parameters:
objects objects to be removed from both sides of the given relationship
key relationship key

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract ERXEnterpriseObject self (  )  [pure virtual]

self is usefull for directtoweb purposes

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract String toLongString (  )  [pure virtual]

Returns the super classes implementation of toString which prints out the current key-value pairs for all of the attributes and relationships for the current object. Very verbose.

Returns:
super's implementation of toString.

Implemented in ERCMailMessage, ERXCustomObject, and ERXGenericRecord.

abstract void trimSpaces (  )  [pure virtual]

This method will trim the leading and trailing white space from any attributes that are mapped to a String object. This method is called before the object is saved to the database. Override this method to do nothing if you wish to preserve your leading and trailing white space.

Implemented in ERXCustomObject, and ERXGenericRecord.

abstract void willDelete (  )  throws NSValidation.ValidationException [pure virtual]

Called as part of the augmented transaction process. This method is called after saveChanges is called on the editing context, but before the object is actually deleted from the database. This method is also called before validateForDelete is called on this object. This method is called by the editing context delegate ERXDefaultEditingContextDelegate.

Exceptions:
NSValidation.ValidationException to stop the object from being deleted.

Implemented in ERCStampedEnterpriseObject, ERTag, ERXCustomObject, ERXGenericRecord, and ERXPartialGenericRecord.

abstract void willInsert (  )  [pure virtual]

Called as part of the augmented transaction process. This method is called after saveChanges is called on the editing context, but before the object is actually inserted into the database. This method is also called before validateForInsert is called on this object. This method is called by the editing context delegate ERXDefaultEditingContextDelegate.

Implemented in ERCStampedEnterpriseObject, ERXCustomObject, ERXGenericRecord, and ERXPartialGenericRecord.

abstract void willRevert (  )  [pure virtual]

Called on the object before it will be reverted.

Default implementation does nothing other than log.

Implemented in ERXCustomObject, ERXGenericRecord, and ERXPartialGenericRecord.

abstract void willUpdate (  )  [pure virtual]

Called as part of the augmented transaction process. This method is called after saveChanges is called on the editing context, but before the object is actually updated in the database. This method is also called before validateForSave is called on this object. This method is called by the editing context delegate ERXDefaultEditingContextDelegate.

Implemented in ERCStampedEnterpriseObject, ERXCustomObject, ERXGenericRecord, and ERXPartialGenericRecord.


Member Data Documentation

final boolean applyRestrictingQualifierOnInsert = ERXProperties.booleanForKey("er.extensions.ERXEnterpriseObject.applyRestrictingQualifierOnInsert") [static]

Initial value:

 new Processor() {
        protected void perform(EOEditingContext ec, ERXEnterpriseObject eo) {
            eo.didDelete(ec);
        }
    }

Initial value:

 new Processor() {
        protected void perform(EOEditingContext ec, ERXEnterpriseObject eo) {
            eo.didInsert();
        }
    }

Initial value:

 new Processor() {
        protected void perform(EOEditingContext ec, ERXEnterpriseObject eo) {
            eo.didRevert(ec);
        }
    }

Initial value:

 new Processor() {
        protected void perform(EOEditingContext ec, ERXEnterpriseObject eo) {
            eo.didUpdate();
        }
    }

Initial value:

 new Processor() {
        protected void perform(EOEditingContext ec, ERXEnterpriseObject eo) {
            eo.flushCaches();
        }
    }

final Logger insertionTrackingLog [static]

Initial value:

 Logger
            .getLogger("er.extensions.ERXGenericRecord.insertion")
logging support for insertion tracking

final String KEY_MARKER = "** KEY_MARKER **" [static]

final Logger log [static]

final Logger logMod = Logger.getLogger("er.transaction.delegate.EREditingContextDelegate.modifiedObjects") [static]

logging support for modified objects

final Logger tranLogDidDelete [static]

Initial value:

 Logger
            .getLogger("er.transaction.eo.did.delete.ERXGenericRecord")
logging support. Called after an object is successfully deleted

final Logger tranLogDidInsert [static]

Initial value:

 Logger
            .getLogger("er.transaction.eo.did.insert.ERXGenericRecord")
logging support. Called after an object is successfully inserted

final Logger tranLogDidRevert [static]

Initial value:

 Logger
            .getLogger("er.transaction.eo.did.revert.ERXGenericRecord")
logging support. Called after an object is reverted.

final Logger tranLogDidUpdate [static]

Initial value:

 Logger
            .getLogger("er.transaction.eo.did.update.ERXGenericRecord")
logging support. Called after an object is successfully updated

final Logger tranLogMightDelete [static]

Initial value:

 Logger
            .getLogger("er.transaction.eo.might.delete.ERXGenericRecord")
logging support. Called before an object is deleted

final Logger tranLogWillDelete [static]

Initial value:

 Logger
            .getLogger("er.transaction.eo.will.delete.ERXGenericRecord")
logging support. Called before an object is deleted

final Logger tranLogWillInsert [static]

Initial value:

 Logger
            .getLogger("er.transaction.eo.will.insert.ERXGenericRecord")
logging support. Called before an object is inserted

final Logger tranLogWillRevert [static]

Initial value:

 Logger
            .getLogger("er.transaction.eo.will.revert.ERXGenericRecord")
logging support. Called before an object is reverted.

final Logger tranLogWillUpdate [static]

Initial value:

 Logger
            .getLogger("er.transaction.eo.will.update.ERXGenericRecord")
logging support. Called before an object is updated

final Logger validation [static]

Initial value:

 Logger
            .getLogger("er.eo.validation.ERXGenericRecord")
logging support for validation information

final Logger validationException [static]

Initial value:

 Logger
            .getLogger("er.eo.validationException.ERXGenericRecord")
logging support for validation exceptions

Initial value:

 new Processor() {
        protected void perform(EOEditingContext ec, ERXEnterpriseObject eo) {
            eo.willDelete();
        }
    }

Initial value:

 new Processor() {
        protected void perform(EOEditingContext ec, ERXEnterpriseObject eo) {
            eo.willInsert();
        }
    }

Initial value:

 new Processor() {
        protected void perform(EOEditingContext ec, ERXEnterpriseObject eo) {
            eo.willRevert();
        }
    }

Initial value:

 new Processor() {
        protected void perform(EOEditingContext ec, ERXEnterpriseObject eo) {
            eo.willUpdate();
        }
    }


The documentation for this interface was generated from the following file:

Generated on Sat May 26 06:43:08 2012 for Project Wonder by  doxygen 1.5.8