+2006-08-31 Wolfgang Sourdeau <WSourdeau@Inverse.CA>
+
+ * EOQualifier+GCS.m: added support for OR qualifiers and for case
+ insensitive-like qualifiers on PostgreSQL (v4.5.37)
+
2006-07-04 Helge Hess <helge.hess@opengroupware.org>
* use %p for pointer formats, fixed gcc 4.1 warnings (v4.5.36)
if (count > 1) [_ms appendString:@")"];
}
}
+- (void)_appendOrQualifier:(EOAndQualifier *)_q
+ toString:(NSMutableString *)_ms
+{
+ // TODO: move to EOQualifier category
+ NSArray *qs;
+ unsigned i, count;
+
+ qs = [_q qualifiers];
+ if ((count = [qs count]) == 0)
+ return;
+
+ for (i = 0; i < count; i++) {
+ if (i != 0) [_ms appendString:@" OR "];
+ if (count > 1) [_ms appendString:@"("];
+ [[qs objectAtIndex:i] _gcsAppendToString:_ms];
+ if (count > 1) [_ms appendString:@")"];
+ }
+}
- (void)_appendKeyValueQualifier:(EOKeyValueQualifier *)_q
toString:(NSMutableString *)_ms
{
[_ms appendString:@" >= "];
else if (sel_eq(op, EOQualifierOperatorLike))
[_ms appendString:@" LIKE "];
+ else if (sel_eq(op, EOQualifierOperatorCaseInsensitiveLike)) {
+ // TODO: this is PostgreSQL specific, use UPPER?
+ [_ms appendString:@" ILIKE "];
+ }
else {
[self logWithFormat:@"ERROR(%s): unsupported operation for null: %@",
__PRETTY_FUNCTION__, NSStringFromSelector(op)];
if ([_q isKindOfClass:[EOAndQualifier class]])
[self _appendAndQualifier:(id)_q toString:_ms];
+ else if ([_q isKindOfClass:[EOOrQualifier class]])
+ [self _appendOrQualifier:(id)_q toString:_ms];
else if ([_q isKindOfClass:[EOKeyValueQualifier class]])
[self _appendKeyValueQualifier:(id)_q toString:_ms];
else