title: Core Data: Fetch result from multiple entities or relationship
body: <p>I have two entities. <code>Employee</code> entity </p>
  
  <pre><code>@interface Employee : NSManagedObject
  
  @property (nonatomic, retain) NSString * dept;
  @property (nonatomic, retain) NSString * email;
  @property (nonatomic, retain) NSString * name;
  @property (nonatomic, retain) Department *deptEmp;
  
  @end
  </code></pre>
  
  <p>and <code>Department</code> entity</p>
  
  <pre><code>@interface Department : NSManagedObject
  
  @property (nonatomic, retain) NSString * location;
  @property (nonatomic, retain) NSString * name;
  @property (nonatomic, retain) Employee *deptEmp1;
  </code></pre>
  
  <p>I am trying to fetch information from both with following predicate</p>
  
  <pre><code>NSMutableString *queryString = [NSMutableString stringWithFormat:@"(name = 'Apple') AND (deptEmp1.location like 'Cupertino')"];
  
  NSEntityDescription *entityDescription = [NSEntityDescription entityForName:@"Employee" inManagedObjectContext:self.managedObjectContext];
  </code></pre>
  
  <p><strong>And Fetch Request is</strong>  </p>
  
  <pre><code>NSFetchRequest *request = [[NSFetchRequest alloc] init];
  [request setEntity:entityDescription];
  [request setResultType:NSDictionaryResultType]; // NSFetchRequestResultType - NSDictionaryResultType
  [request setRelationshipKeyPathsForPrefetching:[NSArray arrayWithObjects:@"Department",nil]];
  [request setIncludesSubentities:YES];
  </code></pre>
  
  <p><strong>Setting Predicate</strong></p>
  
  <pre><code>if(![queryString isEqualToString:@""])
  {
          [request setPredicate:[NSPredicate predicateWithFormat:queryString]];
  }
  
  NSError *error = nil;
  NSArray *returnArray = nil;
  </code></pre>
  
  <p><strong>Fetching Result</strong></p>
  
  <pre><code>@synchronized(self)
  {
      returnArray = [self.managedObjectContext executeFetchRequest:request error:&amp;error];
  }
  </code></pre>
  
  <p>But here I never get result.</p>