mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 04:46:01 +08:00
Integrated primaryKey extension to NSEntityDescription and refactored cache strategy
classes to eliminate issues with duplicated objects. closes #611, #612, #613, #618 * NSEntityDescription is now aware of the primaryKeyAttribute. Can be configured via Interface Builder within Xcode or programatically. * Added findByPrimaryKey: interface to the Core Data extensions. * Relaxed dependencies on RKManagedObjectMapping across the system now that primaryKey is available without a reference to the mapping.
This commit is contained in:
@@ -22,7 +22,8 @@
|
||||
@end
|
||||
|
||||
/**
|
||||
Extensions for NSManage
|
||||
Provides extensions to NSManagedObject implementing a low-ceremony querying
|
||||
interface.
|
||||
*/
|
||||
@interface NSManagedObject (ActiveRecord)
|
||||
|
||||
@@ -102,6 +103,25 @@
|
||||
*/
|
||||
- (BOOL)isNew;
|
||||
|
||||
/**
|
||||
Finds the instance of the receiver's entity with the given value for the primary key attribute
|
||||
in the managed object context for the current thread.
|
||||
|
||||
@param primaryKeyValue The value for the receiving entity's primary key attribute.
|
||||
@return The object with the primary key attribute equal to the given value or nil.
|
||||
*/
|
||||
+ (id)findByPrimaryKey:(id)primaryKeyValue;
|
||||
|
||||
/**
|
||||
Finds the instance of the receiver's entity with the given value for the primary key attribute in
|
||||
the given managed object context.
|
||||
|
||||
@param primaryKeyValue The value for the receiving entity's primary key attribute.
|
||||
@param context The managed object context to find the instance in.
|
||||
@return The object with the primary key attribute equal to the given value or nil.
|
||||
*/
|
||||
+ (id)findByPrimaryKey:(id)primaryKeyValue inContext:(NSManagedObjectContext *)context;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+ (NSManagedObjectContext*)currentContext;
|
||||
|
||||
Reference in New Issue
Block a user