Class: NSEntityMapping

Inherits:
NSObject show all

Overview

Instances of NSEntityMapping specify how to map an entity from a source to a destination managed object model.

Instance Method Summary (collapse)

Methods inherited from NSObject

#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version

Constructor Details

This class inherits a constructor from NSObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NSObject

Instance Method Details

- (Array) attributeMappings

Returns the array of attribute mappings for the receiver.

Returns:

  • (Array)

    The array of attribute mappings for the receiver.

- (String) destinationEntityName

Returns the destination entity name for the receiver. Mappings are not directly bound to entity descriptions. You can use the migration manager’s destinationEntityForEntityMapping: method to retrieve the entity description for this entity name.

Returns:

  • (String)

    The destination entity name for the receiver.

- (NSData) destinationEntityVersionHash

Returns the version hash for the destination entity for the receiver. The version hash is calculated by Core Data based on the property values of the entity (see NSEntityDescription’s versionHash method). The destinationEntityVersionHash must equal the version hash of the destination entity represented by the mapping.

Returns:

  • (NSData)

    The version hash for the destination entity for the receiver.

- (String) entityMigrationPolicyClassName

Returns the class name of the migration policy for the receiver. If not specified, the default migration class name is NSEntityMigrationPolicy. You can specify a subclass to provide custom behavior.

Returns:

  • (String)

    The class name of the migration policy for the receiver.

- (NSEntityMappingType) mappingType

Returns the mapping type for the receiver.

Returns:

  • (NSEntityMappingType)

    The mapping type for the receiver.

- (String) name

Returns the name of the receiver. The name is used only as a means of distinguishing mappings in a model. If not specified, the value defaults to SOURCE->DESTINATION.

Returns:

  • (String)

    The name of the receiver.

- (Array) relationshipMappings

Returns the array of relationship mappings for the receiver.

Returns:

  • (Array)

    The array of relationship mappings for the receiver.

- (Object) setAttributeMappings(mappings)

Sets the array of attribute mappings for the receiver.

Parameters:

  • mappings (Array)

    The array of attribute mappings for the receiver.

Returns:

- (Object) setDestinationEntityName(name)

Sets the destination entity name for the receiver.

Parameters:

  • name (String)

    The destination entity name.

Returns:

- (Object) setDestinationEntityVersionHash(vhash)

Sets the version hash for the destination entity for the receiver.

Parameters:

  • vhash (NSData)

    The version hash for the destination entity.

Returns:

- (Object) setEntityMigrationPolicyClassName(name)

Sets the class name of the migration policy for the receiver.

Parameters:

Returns:

- (Object) setMappingType(type)

Sets the mapping type for the receiver. If you specify a custom entity mapping type, you must specify a value for the migration policy class name as well (see setEntityMigrationPolicyClassName:).

Parameters:

  • type (NSEntityMappingType)

    The mapping type for the receiver.

Returns:

- (Object) setName(name)

Sets the name of the receiver.

Parameters:

  • name (String)

    The name of the receiver.

Returns:

- (Object) setRelationshipMappings(mappings)

Sets the array of relationship mappings for the receiver.

Parameters:

  • mappings (Array)

    The array of relationship mappings for the receiver.

Returns:

- (Object) setSourceEntityName(name)

Sets the source entity name for the receiver.

Parameters:

  • name (String)

    The source entity name for the receiver.

Returns:

- (Object) setSourceEntityVersionHash(vhash)

Sets the version hash for the source entity for the receiver.

Parameters:

  • vhash (NSData)

    The version hash for the source entity for the receiver.

Returns:

- (Object) setSourceExpression(source)

Sets the source expression for the receiver.

Parameters:

  • source (NSExpression)

    The source expression for the receiver. The expression can be a fetch request expression, or any other expression which evaluates to a collection.

Returns:

- (Object) setUserInfo(dict)

Sets the user info dictionary for the receiver. You can set the contents of the dictionary using the appropriate inspector in the Xcode mapping model editor.

Parameters:

  • dict (Hash)

    The user info dictionary for the receiver.

Returns:

- (String) sourceEntityName

Returns the source entity name for the receiver. Mappings are not directly bound to entity descriptions; you can use the sourceEntityForEntityMapping: method on the migration manager to retrieve the entity description for this entity name.

Returns:

  • (String)

    The source entity name for the receiver.

- (NSData) sourceEntityVersionHash

Returns the version hash for the source entity for the receiver. The version hash is calculated by Core Data based on the property values of the entity (see NSEntityDescription’s versionHash method). The sourceEntityVersionHash must equal the version hash of the source entity represented by the mapping.

Returns:

  • (NSData)

    The version hash for the source entity for the receiver.

- (NSExpression) sourceExpression

Returns the source expression for the receiver. The source expression is used to obtain the collection of managed objects to process through the mapping.

Returns:

  • (NSExpression)

    The source expression. The expression can be a fetch request expression, or any other expression which evaluates to a collection.

- (Hash) userInfo

Returns the user info dictionary for the receiver. You can use the info dictionary in any way that might be useful in your migration. You set the contents of the dictionary using setUserInfo: or using the appropriate inspector in the Xcode mapping model editor.

Returns:

  • (Hash)

    The user info dictionary.