Project Wonder 2.0

er.extensions
Class ERXDefaultEditingContextDelegate

java.lang.Object
  extended byer.extensions.ERXEditingContextDelegate
      extended byer.extensions.ERXDefaultEditingContextDelegate
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ERXECNoValidationDelegate

public class ERXDefaultEditingContextDelegate
extends ERXEditingContextDelegate

Default editing context delegate. This delegate augments the regular transaction process by adding the calling of willInsert, willUpdate or willDelete on enterprise objects that are of type ERXGenericRecord after saveChanges is called on the editing context, but before validateForSave is called on the object. These methods can give the object a last chance to modify itself before validation occurs. The second enhancement is a built in flushing of caches on subclasses of ERXGenericRecords when objects have changes merged in or are invalidated. Being able to maintain caches on enterprise objects that are flushed when the underlying values change can be very handy.

See Also:
Serialized Form

Field Summary
static ERXLogger log
          logging support
static ERXLogger logMod
          logging support for modified objects
 
Constructor Summary
ERXDefaultEditingContextDelegate()
          Constructor needed for Serialable interface
 
Method Summary
 boolean editingContextShouldInvalidateObject(EOEditingContext anEOEditingContext, EOEnterpriseObject anObject, EOGlobalID anEOGlobalID)
          When invalidating an object their local cache is flushed by calling the method: flushCaches on the enterprise object if it is an instance of ERXGenericRecord.
 boolean editingContextShouldMergeChangesForObject(EOEditingContext anEditingContext, EOEnterpriseObject object)
          When merging changes into an object their local cache is flushed by calling the method: flushCaches on the enterprise object if it is an instance of ERXGenericRecord.
 void editingContextWillSaveChanges(EOEditingContext ec)
          Enumerates through all of the objects that have been changed, inserted and deleted calling the appropriate will* method, willInsert, etc. on each of the objects if they are of type ERXGenericRecord.
 boolean isInWillSaveChanges()
          Can tell if the delegate is in the middle of a call to will save changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final ERXLogger log
logging support


logMod

public static final ERXLogger logMod
logging support for modified objects

Constructor Detail

ERXDefaultEditingContextDelegate

public ERXDefaultEditingContextDelegate()
Constructor needed for Serialable interface

Method Detail

isInWillSaveChanges

public boolean isInWillSaveChanges()
Can tell if the delegate is in the middle of a call to will save changes.

Returns:
if the delegate is already processing a request at the time when another request comes in.

editingContextWillSaveChanges

public void editingContextWillSaveChanges(EOEditingContext ec)
                                   throws Throwable
Enumerates through all of the objects that have been changed, inserted and deleted calling the appropriate will* method, willInsert, etc. on each of the objects if they are of type ERXGenericRecord. Note that this method is called before validateForSave is called on any of the objects.

Parameters:
ec - editing context that is about to be saved.
Throws:
Throwable

editingContextShouldInvalidateObject

public boolean editingContextShouldInvalidateObject(EOEditingContext anEOEditingContext,
                                                    EOEnterpriseObject anObject,
                                                    EOGlobalID anEOGlobalID)
When invalidating an object their local cache is flushed by calling the method: flushCaches on the enterprise object if it is an instance of ERXGenericRecord.

Parameters:
anObject - enterprise object to be invlidated
anEOGlobalID - global id to be invalidated
Returns:
true

editingContextShouldMergeChangesForObject

public boolean editingContextShouldMergeChangesForObject(EOEditingContext anEditingContext,
                                                         EOEnterpriseObject object)
When merging changes into an object their local cache is flushed by calling the method: flushCaches on the enterprise object if it is an instance of ERXGenericRecord.

Parameters:
anEditingContext - current editing context
object - enterprise object to have changes merged into it.
Returns:
true

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.