Skip to content
Snippets Groups Projects
Commit 1c307020 authored by cramakri's avatar cramakri
Browse files

Renamed entityFetchRequest to fetchRequestForEntities and added methods to...

Renamed entityFetchRequest to fetchRequestForEntities and added methods to return other fetch requests.

SVN: 27453
parent 9bf11d1e
No related branches found
No related tags found
No related merge requests found
......@@ -62,7 +62,10 @@
- (NSArray *)entitiesByPermId:(NSArray *)permIds error:(NSError **)error;
- (NSArray *)entitiesNotUpdatedSince:(NSDate *)date error:(NSError **)error;
- (NSFetchRequest *)entityFetchRequest;
- (NSFetchRequest *)fetchRequestForEntities;
- (NSFetchRequest *)fetchRequestForEntitiesByPermId:(NSArray *)permIds;
- (NSFetchRequest *)fetchRequestForEntitiesNotUpdatedSince:(NSDate *)date;
- (NSArray *)executeFetchRequest:(NSFetchRequest *)fetchRequest error:(NSError **)error;
@end
......@@ -165,25 +165,23 @@ static NSManagedObjectContext* GetMainThreadManagedObjectContext(NSURL* storeUrl
- (NSArray *)allIpadEntitiesOrError:(NSError **)error;
{
NSFetchRequest* request = self.entityFetchRequest;
NSFetchRequest* request = [self fetchRequestForEntities];
return [self executeFetchRequest: request error: error];
}
- (NSArray *)entitiesByPermId:(NSArray *)permIds error:(NSError **)error
{
NSDictionary *fetchVariables = [NSDictionary dictionaryWithObject: permIds forKey: @"PERM_IDS"];
NSFetchRequest *request = [self.managedObjectModel fetchRequestFromTemplateWithName: @"EntitiesByPermIds" substitutionVariables: fetchVariables];
NSFetchRequest *request = [self fetchRequestForEntitiesByPermId: permIds];
return [self executeFetchRequest: request error: error];
}
- (NSArray *)entitiesNotUpdatedSince:(NSDate *)date error:(NSError **)error
{
NSDictionary *fetchVariables = [NSDictionary dictionaryWithObject: date forKey: @"LAST_UPDATE_DATE"];
NSFetchRequest *request = [self.managedObjectModel fetchRequestFromTemplateWithName: @"EntitiesNotUpdatedSince" substitutionVariables: fetchVariables];
NSFetchRequest *request = [self fetchRequestForEntitiesNotUpdatedSince: date];
return [self executeFetchRequest: request error: error];
}
- (NSFetchRequest *)entityFetchRequest
- (NSFetchRequest *)fetchRequestForEntities
{
NSFetchRequest *request = [[NSFetchRequest alloc] init];
[request setEntity: self.ipadEntityDescription];
......@@ -195,6 +193,20 @@ static NSManagedObjectContext* GetMainThreadManagedObjectContext(NSURL* storeUrl
return [self.managedObjectContext executeFetchRequest: fetchRequest error: error];
}
- (NSFetchRequest *)fetchRequestForEntitiesByPermId:(NSArray *)permIds
{
NSDictionary *fetchVariables = [NSDictionary dictionaryWithObject: permIds forKey: @"PERM_IDS"];
NSFetchRequest *request = [self.managedObjectModel fetchRequestFromTemplateWithName: @"EntitiesByPermIds" substitutionVariables: fetchVariables];
return request;
}
- (NSFetchRequest *)fetchRequestForEntitiesNotUpdatedSince:(NSDate *)date
{
NSDictionary *fetchVariables = [NSDictionary dictionaryWithObject: date forKey: @"LAST_UPDATE_DATE"];
NSFetchRequest *request = [self.managedObjectModel fetchRequestFromTemplateWithName: @"EntitiesNotUpdatedSince" substitutionVariables: fetchVariables];
return request;
}
@end
@implementation CISDOBIpadServiceManagerCall
......
......@@ -58,7 +58,7 @@
- (NSArray *)entitiesWithChildren
{
NSError *error;
NSFetchRequest* request = self.serviceManager.entityFetchRequest;
NSFetchRequest* request = [self.serviceManager fetchRequestForEntities];
NSArray *elements = [self.serviceManager executeFetchRequest: request error: &error];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment