GNUstep Core Data  0.1
Public Member Functions
NSManagedObject Class Reference

Validates whether ``value'' is a valid value for ``attribute'', returning YES if it is, and NO if it isn't and setting the error in ``error''. More...

List of all members.

Public Member Functions

(id) - initWithEntity:insertIntoManagedObjectContext:
 The designated initializer for NSManagedObject.
(NSManagedObjectContext *) - managedObjectContext
 Returns the managed object context to which the receiver belongs.
(NSEntityDescription *) - entity
 Returns the entity of the receiver.
(NSManagedObjectID *) - objectID
 Returns the object ID of the receiver.
(BOOL) - isInserted
 Returns YES if the receiver is inserted in a managed object context, and NO otherwise.
(BOOL) - isUpdated
 Returns YES if the receiver has changes that have not yet been written to a persistent store (the receiver has been changed since the last save operation).
(BOOL) - isDeleted
 Returns YES if the receiver has been scheduled in it's parent managed object context for deletion from the persistent store and NO otherwise.
(BOOL) - isFault
 Returns YES if the receiver is a fault, and NO otherwise.
(void) - awakeFromFetch
 Invoked automatically after the receiver has been fetched from a persistent store.
(void) - awakeFromInsert
 Invoked automatically after the receiver has been inserted into a managed object context.
(id) - valueForKey:
 Returns the value for key `aKey' and invokes corresponding KVO methods.
(void) - setValue:forKey:
 Sets the value of key `aKey' to `aValue' and invokes corresponding KVO methods.
(id) - primitiveValueForKey:
 Returns the value for key `aKey' without invoking KVO methods.
(void) - setPrimitiveValue:forKey:
 Sets the value for key `aKey' without invoking KVO methods.
(BOOL) - validateForDelete:
 Validates whether the receiver can be deleted in it's present state from the managed object context returning YES if it can or NO if it can't.

Detailed Description

Validates whether ``value'' is a valid value for ``attribute'', returning YES if it is, and NO if it isn't and setting the error in ``error''.

Does a simmilar job as ValidationAttributeValue, but for relationships. Instances of NSManagedObject (and subclasses of it) are the objects of principal concern in Core Data. They serve as the primary data objects in your Core Data data model.

For more efficient functioning Core Data allows for "fault" objects, i.e. managed objects which don't contain any of their key-values set. Upon requesting or setting some key's value the fault is "fired" and the managed object's state is read from the persistent store. Methods do cause fault firing are explicitly noted as such.

Definition at line 36 of file NSManagedObject.h.


Member Function Documentation

- (void) awakeFromFetch

Invoked automatically after the receiver has been fetched from a persistent store.

You can use this to compute derived values

  • in that case, use -setPrimitiveValue:forKey: to set the changes.

Definition at line 362 of file NSManagedObject.m.

- (NSEntityDescription *) entity

Returns the entity of the receiver.

Doesn't fire a fault.

Definition at line 298 of file NSManagedObject.m.

- (id) initWithEntity: (NSEntityDescription *)  entity
insertIntoManagedObjectContext: (NSManagedObjectContext *)  ctxt 

The designated initializer for NSManagedObject.

This method initializes a managed object and inserts it into `aContext'. The provided `anEntity' argument must be a non-abstract entity, otherwise an exception is thrown.

Returns:
The receiver of the message.

Definition at line 265 of file NSManagedObject.m.

- (BOOL) isDeleted

Returns YES if the receiver has been scheduled in it's parent managed object context for deletion from the persistent store and NO otherwise.

Doesn't fire a fault.

Definition at line 343 of file NSManagedObject.m.

- (BOOL) isFault

Returns YES if the receiver is a fault, and NO otherwise.

Doesn't fire a fault.

Definition at line 352 of file NSManagedObject.m.

- (BOOL) isInserted

Returns YES if the receiver is inserted in a managed object context, and NO otherwise.

Doesn't fire a fault.

Definition at line 323 of file NSManagedObject.m.

- (BOOL) isUpdated

Returns YES if the receiver has changes that have not yet been written to a persistent store (the receiver has been changed since the last save operation).

Doesn't fire a fault.

Definition at line 333 of file NSManagedObject.m.

Returns the managed object context to which the receiver belongs.

Doesn't fire a fault.

Definition at line 290 of file NSManagedObject.m.

Returns the object ID of the receiver.

If the receiver is not yet saved to a persistent store the returned ID is temporary, otherwise it is permanent. Doesn't fire a fault.

Definition at line 308 of file NSManagedObject.m.

- (BOOL) validateForDelete: (NSError **)  error

Validates whether the receiver can be deleted in it's present state from the managed object context returning YES if it can or NO if it can't.

Deleting an object is not allowed if it, for example, contains an established relationship with a "deny" delete rule.

Definition at line 465 of file NSManagedObject.m.


The documentation for this class was generated from the following files: