2005-10-03 Helge Hess <helge.hess@opengroupware.org>
+ * v4.5.11
+
+ * EOFetchSpecification+CoreData.m: only transfer limit to
+ NSFetchRequest if its != 0
+
+ * EOCompoundQualifiers.m: added support for qualifier=>predicate
+ conversion
+
* improved qualifier=>predicate conversion support (v4.5.10)
2005-08-23 Helge Hess <helge.hess@opengroupware.org>
}
- (NSPredicate *)asPredicate {
- NSLog(@"TODO(%s): implement me for class %@!", __PRETTY_FUNCTION__,
- NSStringFromClass([self class]));
- return nil;
+ NSArray *tmp;
+
+ tmp = [self subqualifiers];
+ tmp = [tmp valueForKey:@"asPredicate"];
+ return [NSCompoundPredicate andPredicateWithSubpredicates:tmp];
}
@end /* EOAndQualifier(CoreData) */
+
@implementation EOOrQualifier(CoreData)
- (NSCompoundPredicateType)compoundPredicateType {
}
- (NSPredicate *)asPredicate {
- NSLog(@"TODO(%s): implement me for class %@!", __PRETTY_FUNCTION__,
- NSStringFromClass([self class]));
- return nil;
+ NSArray *tmp;
+
+ tmp = [self subqualifiers];
+ tmp = [tmp valueForKey:@"asPredicate"];
+ return [NSCompoundPredicate orPredicateWithSubpredicates:tmp];
}
@end /* EOOrQualifier(CoreData) */
+
@implementation EONotQualifier(CoreData)
- (NSCompoundPredicateType)compoundPredicateType {
- (NSFetchRequest *)fetchRequestWithEntity:(NSEntityDescription *)_entity {
NSFetchRequest *fr;
+ unsigned int limit;
fr = [[[NSFetchRequest alloc] init] autorelease];
[fr setEntity:_entity];
- [fr setFetchLimit:[self fetchLimit]];
+
+ if ((limit = [self fetchLimit]) > 0)
+ [fr setFetchLimit:limit];
+
[fr setPredicate:[[self qualifier] asPredicate]];
[fr setSortDescriptors:[self sortOrderingsAsSortDescriptors]];
return fr;