T
- the EO class that this is a partial ofpublic class ERXPartial<T extends ERXGenericRecord> extends Object implements Serializable
package.html
in
er.extensions.partials
.
ERXPartial
is the superclass of all partial entity implementations.
ERXPartial
is not itself an EO, but is acts as a partial typesafe
wrapper around an existing base EO (which must extend
ERXPartialGenericRecord
). For instance, the base entity might be
Person
, but the partial may be CalendarPerson
which might
expose methods like calendarPerson.scheduledEvents()
.
To obtain a partial, you request an instance from a base EO. Take the
Person
example from above. You can access the interface of the
CalendarPerson
partial in two ways:
Person person = ...;
CalendarPerson calendarPerson = person.partialForClass(CalendarPerson.class);
or
Person person = ...;
CalendarPerson calendarPerson = person.valueForKey("@CalendarPerson");
which allows easy use of the partial entities in component bindings, like
person.@CalendarPerson.scheduledEvents
.Constructor and Description |
---|
ERXPartial() |
Modifier and Type | Method and Description |
---|---|
void |
addObjectToBothSidesOfRelationshipWithKey(EORelationshipManipulation eo,
String key)
Calls
_primaryEO.addObjectToBothSidesOfRelationshipWithKey(eo, key) . |
void |
awakeFromFetch(EOEditingContext editingContext)
Delegated from the base entity.
|
void |
delete()
Delegated from the base entity.
|
void |
didDelete(EOEditingContext ec)
Delegated from the base entity.
|
void |
didInsert()
Delegated from the base entity.
|
void |
didRevert(EOEditingContext ec)
Delegated from the base entity.
|
void |
didUpdate()
Delegated from the base entity.
|
EOEditingContext |
editingContext()
Returns the primary EO's
EOEditingContext . |
void |
excludeObjectFromPropertyWithKey(Object value,
String key)
Calls
_primaryEO.excludeObjectFromPropertyWithKey(value, key) . |
void |
includeObjectIntoPropertyWithKey(Object value,
String key)
Calls
_primaryEO.includeObjectIntoPropertyWithKey(value, key) . |
protected void |
init(EOEditingContext editingContext)
Delegated from the base entity.
|
boolean |
isPartialKeypath(String keypath)
Tests the given keypath to see if it is a valid attribute or relationship
for this partial.
|
void |
mightDelete()
Delegated from the base entity.
|
static NSArray<String> |
partialAttributes()
When partial entities are initialized the
EOEntity is removed from the
model, making it impossible to query attributes and relationships later. |
static NSArray<String> |
partialProperties()
When partial entities are initialized the
EOEntity is removed
from the model making it impossible to query attributes and relationships
later. |
static NSArray<String> |
partialRelationships()
When partial entities are initialized the
EOEntity is removed from the
model making it impossible to query attributes and relationships later. |
T |
primaryEO()
Returns this partial's primary EO.
|
void |
removeObjectFromBothSidesOfRelationshipWithKey(EORelationshipManipulation eo,
String key)
Calls
_primaryEO.removeObjectFromBothSidesOfRelationshipWithKey(eo, key) . |
void |
setPrimaryEO(T primaryEO)
Sets this partial's primary EO.
|
Object |
storedValueForKey(String key)
Returns
_primaryEO.storedValueForKey(key) . |
void |
takeStoredValueForKey(Object value,
String key)
Calls
_primaryEO.takeStoredValueForKey(value, key) . |
void |
validateForInsert()
Delegated from the base entity.
|
void |
validateForSave()
Delegated from the base entity.
|
void |
validateForUpdate()
Delegated from the base entity.
|
Object |
validateTakeValueForKeyPath(Object value,
String keyPath)
Delegated from the base entity.
|
Object |
validateValueForKey(Object value,
String key)
Delegated from the base entity.
|
void |
willDelete()
Delegated from the base entity.
|
void |
willInsert()
Delegated from the base entity.
|
void |
willRevert()
Delegated from the base entity.
|
void |
willUpdate()
Delegated from the base entity.
|
public void setPrimaryEO(T primaryEO)
primaryEO
- the primary EOpublic T primaryEO()
public static NSArray<String> partialAttributes()
EOEntity
is removed from the
model, making it impossible to query attributes and relationships later.public static NSArray<String> partialRelationships()
EOEntity
is removed from the
model making it impossible to query attributes and relationships later.public static NSArray<String> partialProperties()
EOEntity
is removed
from the model making it impossible to query attributes and relationships
later.public boolean isPartialKeypath(String keypath)
keypath
- a keypathtrue
if keypath
matches an attribute or
relationshippublic EOEditingContext editingContext()
EOEditingContext
.EOEditingContext
public Object storedValueForKey(String key)
_primaryEO.storedValueForKey(key)
.key
- a key_primaryEO.storedValueForKey(key)
public void takeStoredValueForKey(Object value, String key)
_primaryEO.takeStoredValueForKey(value, key)
.value
- a valuekey
- a keypublic void includeObjectIntoPropertyWithKey(Object value, String key)
_primaryEO.includeObjectIntoPropertyWithKey(value, key)
.value
- a valuekey
- a keypublic void excludeObjectFromPropertyWithKey(Object value, String key)
_primaryEO.excludeObjectFromPropertyWithKey(value, key)
.value
- a valuekey
- a keypublic void addObjectToBothSidesOfRelationshipWithKey(EORelationshipManipulation eo, String key)
_primaryEO.addObjectToBothSidesOfRelationshipWithKey(eo, key)
.eo
- an EORelationshipManipulation
key
- a keypublic void removeObjectFromBothSidesOfRelationshipWithKey(EORelationshipManipulation eo, String key)
_primaryEO.removeObjectFromBothSidesOfRelationshipWithKey(eo, key)
.eo
- an EORelationshipManipulation
key
- a keypublic void awakeFromFetch(EOEditingContext editingContext)
editingContext
- this object's EOEditingContext
public void delete()
public void mightDelete()
public void willDelete() throws NSValidation.ValidationException
NSValidation.ValidationException
- in the case of a validation failurepublic void didDelete(EOEditingContext ec)
ec
- this object's EOEditingContext
public void willInsert()
public void didInsert()
public void willUpdate()
public void didUpdate()
public void willRevert()
public void didRevert(EOEditingContext ec)
ec
- this object's EOEditingContext
public void validateForSave() throws NSValidation.ValidationException
NSValidation.ValidationException
- in the case of a validation failurepublic void validateForInsert() throws NSValidation.ValidationException
NSValidation.ValidationException
- in the case of a validation failurepublic void validateForUpdate() throws NSValidation.ValidationException
NSValidation.ValidationException
- in the case of a validation failurepublic Object validateTakeValueForKeyPath(Object value, String keyPath) throws NSValidation.ValidationException
value
- a valuekeyPath
- a keypathNSValidation.ValidationException
- in the case of a validation failurepublic Object validateValueForKey(Object value, String key) throws NSValidation.ValidationException
value
- a valuekey
- a keyNSValidation.ValidationException
- in the case of a validation failureprotected void init(EOEditingContext editingContext)
init()
method is called.editingContext
- this object's EOEditingContext
Copyright © 2002 – 2024 Project Wonder.