|
Project Wonder 5.0.0.8654 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.webobjects.eocontrol.EOCustomObject
com.webobjects.eocontrol.EOGenericRecord
er.extensions.eof.ERXGenericRecord
public class ERXGenericRecord
This class contains a bunch of extensions to the regular
EOGenericRecord class. Of
notable interest is:
ERXGeneratesPrimaryKeyInterface,
willUpdate
and didDelete and a bunch of handy utility methods like
committedSnapshotValueForKey
.
eo.setFoo(other), eo.takeValueForKey(other),
eo.addObjectToBothSidesOfRelationshipWithKey(other, "foo")
or eo.addToFoos(other) and the inverse relationship will get
updated for you automagically, so that you don't need to call
other.addToBars(eo) or other.setBar(eo). Doing
so doesn't hurt, though. Giving a null value of removing the
object from a to-many will result in the inverse relationship getting
cleared. er.extensions.ERXEnterpriseObject.updateInverseRelationships=true.
| Nested Class Summary | |
|---|---|
static class |
ERXGenericRecord.ERXGenericRecordClazz<T extends EOEnterpriseObject>
Clazz object implementation for ERXGenericRecord. |
static class |
ERXGenericRecord.InverseRelationshipUpdater
Provides automatic inverse relationship updating for ERXGenericRecord and ERXCustomObject. |
static class |
ERXGenericRecord.LocalizedBinding
|
| Nested classes/interfaces inherited from class com.webobjects.eocontrol.EOGenericRecord |
|---|
EOGenericRecord._DictionaryBinding, EOGenericRecord._LazyDictionaryBinding |
| Nested classes/interfaces inherited from class com.webobjects.eocontrol.EOCustomObject |
|---|
EOCustomObject._BooleanFieldBinding, EOCustomObject._FieldBinding, EOCustomObject._LazyFieldBinding, EOCustomObject._NumberFieldBinding |
| Nested classes/interfaces inherited from interface er.extensions.eof.ERXEnterpriseObject |
|---|
ERXEnterpriseObject.Observer, ERXEnterpriseObject.Processor |
| Nested classes/interfaces inherited from interface com.webobjects.eocontrol.EOKeyValueCodingAdditions |
|---|
EOKeyValueCodingAdditions.DefaultImplementation, EOKeyValueCodingAdditions.Utility |
| Nested classes/interfaces inherited from interface com.webobjects.eocontrol.EOKeyValueCoding |
|---|
EOKeyValueCoding._BestBindingCreation, EOKeyValueCoding._KeyBindingCreation, EOKeyValueCoding._StoredForwardingBinding |
| Nested classes/interfaces inherited from interface com.webobjects.foundation.NSValidation |
|---|
NSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.ValidationException |
| Nested classes/interfaces inherited from interface com.webobjects.eocontrol._EOPrivateMemento |
|---|
_EOPrivateMemento.DefaultImplementation |
| Field Summary | |
|---|---|
protected String |
_primaryKey
|
protected String |
insertionStackTrace
|
| Fields inherited from class com.webobjects.eocontrol.EOGenericRecord |
|---|
_CLASS |
| Fields inherited from class com.webobjects.eocontrol.EOCustomObject |
|---|
__readOnly |
| Fields inherited from interface com.webobjects.eocontrol.EOEnterpriseObject |
|---|
_CLASS |
| Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions |
|---|
_KeyPathSeparatorChar, KeyPathSeparator |
| Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding |
|---|
NullValue |
| Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding |
|---|
NullValue |
| Constructor Summary | |
|---|---|
ERXGenericRecord()
|
|
| Method Summary | ||
|---|---|---|
NSKeyValueCoding._KeyBinding |
_otherStorageBinding(String key)
|
|
boolean |
_setUpdateInverseRelationships(boolean newValue)
Toggles whether or not inverse relationships should be updates. |
|
protected boolean |
_updateInverseRelationships()
|
|
protected Object |
_validateValueForKey(Object value,
String key)
|
|
void |
addObjectsToBothSidesOfRelationshipWithKey(NSArray objects,
String key)
Adds a collection of objects to a given relationship by calling addObjectToBothSidesOfRelationshipWithKey for all
objects in the collection. |
|
void |
addObjectToBothSidesOfRelationshipWithKey(EORelationshipManipulation eo,
String key)
Adds a check to make sure that both the object being added and this object are in the same editing context. |
|
protected boolean |
applyRestrictingQualifierOnInsert()
|
|
void |
awakeFromClientUpdate(EOEditingContext editingContext)
Checks the editing context delegate before calling super's implementation. |
|
void |
awakeFromFetch(EOEditingContext editingContext)
Checks the editing context delegate before calling super's implementation. |
|
void |
awakeFromInsertion(EOEditingContext editingContext)
Checks the editing context delegate before calling super's implementation. |
|
void |
batchCheckConsistency()
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. |
|
boolean |
canDelete()
Implementation of ERXGuardedObjectInterface. |
|
boolean |
canUpdate()
Implementation of ERXGuardedObjectInterface. |
|
NSDictionary |
changesFromCommittedSnapshot()
Computes the current set of changes that this object has from the currently committed snapshot. |
|
void |
checkConsistency()
Debugging method that will be called on an object before it is saved to the database if the property key: ERDebuggingEnabled is enabled. |
|
static void |
checkMatchingEditingContexts(EOEnterpriseObject source,
String relationshipName,
EOEnterpriseObject destination)
Checks that the editing contexts in source and destination matches and throws an exception if they do not. |
|
void |
clearProperties()
|
|
NSDictionary |
committedSnapshot()
This method exists because EOEditingContext.committedSnapshotForObject()
gives unexpected results for newly inserted objects if
EOEditingContext.processRecentChanges()
has been called. |
|
Object |
committedSnapshotValueForKey(String key)
Determines what the value of the given key is in the committed snapshot |
|
void |
delete()
Implementation of ERXGuardedObjectInterface. |
|
String |
description()
Cover method to return toString. |
|
void |
didDelete(EOEditingContext ec)
Called on the object after is has been deleted. |
|
void |
didInsert()
Called on the object after is has successfully been inserted into the database. |
|
void |
didRevert(EOEditingContext ec)
Called on the object after it has been reverted. |
|
void |
didUpdate()
Called on the object after is has successfully been updated in the database. |
|
String |
encryptedPrimaryKey()
Takes the primary key of the object and encrypts it with the blowfish cipher using ERXCrypto. |
|
EOEntity |
entity()
Returns the entity for the current object. |
|
void |
excludeObjectFromPropertyWithKey(Object o,
String key)
Overridden to support two-way relationship setting. |
|
void |
flushCaches()
This is called when an object has had changes merged into it by the editing context. |
|
Object |
foreignKeyForRelationshipWithKey(String rel)
Returns the foreign key for a given relationship. |
|
Logger |
getClassLog()
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. |
|
void |
includeObjectIntoPropertyWithKey(Object o,
String key)
Overridden to support two-way relationship setting. |
|
protected void |
init(EOEditingContext ec)
used for initialization stuff instead of awakeFromInsertion. |
|
boolean |
isDeletedEO()
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. |
|
boolean |
isNewEO()
Deprecated. use ERXGenericRecord#isNewObject |
|
boolean |
isNewObject()
Determines if this object is a new object and hasn't been saved to the database yet. |
|
boolean |
isUpdatedObject()
Returns true if this EO has been modified in this editing context. |
|
NSArray<String> |
localesForKey(String key)
Returns all available ERXLanguages for the given key |
|
EOEnterpriseObject |
localInstanceIn(EOEditingContext ec)
Returns this EO in the supplied editing context. |
|
EOEnterpriseObject |
localInstanceOf(EOEnterpriseObject eo)
Returns an EO in the same editing context as the caller. |
|
NSArray |
localInstancesOf(NSArray eos)
Returns an array of EOs in the same editing context as the caller. |
|
static boolean |
localizationShouldFallbackToDefaultLanguage()
|
|
void |
mightDelete()
Called as part of the augmented transaction process. |
|
boolean |
parentObjectStoreIsObjectStoreCoordinator()
Simple method that will return if the parent object store of this object's editing context is an instance of EOObjectStoreCoordinator. |
|
EOKeyGlobalID |
permanentGlobalID()
Calls permanentGlobalID(boolean) passing true for generateIfMissing. |
|
EOKeyGlobalID |
permanentGlobalID(boolean generateIfMissing)
This method allows you to compute what the permanent EOGlobalID will be for an object before it has been saved to the database. |
|
String |
primaryKey()
Primary key of the object as a String. |
|
NSArray<String> |
primaryKeyAttributeNames()
Returns the names of all primary key attributes. |
|
NSDictionary<String,Object> |
primaryKeyDictionary(boolean inTransaction)
Implementation of the interface ERXGeneratesPrimaryKeyInterface. |
|
String |
primaryKeyInTransaction()
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. |
|
Object |
rawPrimaryKey()
Gives the raw primary key of the object. |
|
Object |
rawPrimaryKeyInTransaction()
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. |
|
ERXEnterpriseObject |
refetchObjectFromDBinEditingContext(EOEditingContext ec)
Method that will make sure to fetch an eo from the Database and place it in the editingContext provided as an argument |
|
void |
removeObjectsFromBothSidesOfRelationshipWithKey(NSArray objects,
String key)
Removes a collection of objects to a given relationship by calling removeObjectFromBothSidesOfRelationshipWithKey for all
objects in the collection. |
|
void |
removeObjectsFromPropertyWithKey(NSArray objects,
String key)
Removes a collection of objects to a given relationship by calling removeObjectFromPropertyWithKey for all
objects in the collection. |
|
ERXEnterpriseObject |
self()
self is usefull for directtoweb purposes |
|
static boolean |
shouldTrimSpaces()
|
|
void |
takeStoredValueForKey(Object value,
String key)
|
|
|
takeValueForKey(Object value,
ERXKey<T> key)
Type-safe KVC setter (final for now) |
|
void |
takeValueForKey(Object value,
String key)
Overridden to support two-way relationship setting. |
|
String |
toLongString()
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. |
|
String |
toString()
Overrides the EOGenericRecord's implementation to provide a slightly less verbose output. |
|
void |
trimSpaces()
This method will trim the leading and trailing white space from any attributes that are mapped to a String object. |
|
void |
updateFromSnapshot(NSDictionary snapshot)
This method explicitly turns off inverse relationship updating, because it's only called during undo and revert inside of EOF. |
|
void |
validateForInsert()
Calls up validateForInsert() on the class description if it supports it. |
|
void |
validateForSave()
This method performs a few checks before invoking super's implementation. |
|
void |
validateForUpdate()
Calls up validateForUpdate() on the class description if it supports it. |
|
Object |
validateValueForKey(Object value,
String key)
Overrides the default validation mechanisms to provide a few checks before invoking super's implementation, which incidently just invokes validateValueForKey on the object's class description. |
|
|
valueForKey(ERXKey<T> key)
Type-safe KVC getter (final for now) |
|
void |
willDelete()
Called as part of the augmented transaction process. |
|
void |
willInsert()
Called as part of the augmented transaction process. |
|
Object |
willReadRelationship(Object aObject)
|
|
void |
willRevert()
Called on the object before it will be reverted. |
|
void |
willUpdate()
Called as part of the augmented transaction process. |
|
| Methods inherited from class com.webobjects.eocontrol.EOGenericRecord |
|---|
__setClassDescription, _keyGetBindingForKey, _keySetBindingForKey, _storedKeyGetBindingForKey, _storedKeySetBindingForKey, classDescription, usesDeferredFaultCreation |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.webobjects.eocontrol.EOKeyValueCodingAdditions |
|---|
takeValuesFromDictionary, takeValuesFromDictionaryWithMapping, valuesForKeys, valuesForKeysWithMapping |
| Methods inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions |
|---|
takeValueForKeyPath, valueForKeyPath |
| Methods inherited from interface com.webobjects.foundation.NSKeyValueCoding |
|---|
valueForKey |
| Methods inherited from interface com.webobjects.eocontrol.EOKeyValueCoding |
|---|
storedValueForKey |
| Methods inherited from interface com.webobjects.foundation.NSKeyValueCoding |
|---|
valueForKey |
| Methods inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling |
|---|
handleQueryWithUnboundKey, handleTakeValueForUnboundKey, unableToSetNullForKey |