[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GDL2, EOSQLQualifier Implementation
From: |
David Ayers |
Subject: |
Re: GDL2, EOSQLQualifier Implementation |
Date: |
Fri, 24 Jul 2009 19:12:16 +0200 |
Am Freitag, den 24.07.2009, 12:17 +0800 schrieb Georg Fleischmann:
> here is my implementation of EOSQLQualifier.
> EOExpressionArray seems to be an overkill here, but I just used the
> ivar as is.
>
> * EOAccess/EOSQLQualifier:
> [EOSQLQualifier -initWithEntity:qualifierFormat:]
> [EOSQLQualifier -schemaBasedQualifierWithRootEntity:]
> [EOSQLQualifier -sqlStringForSQLExpression:]
> [EOSQLQualifier -dealloc]
> implemented
Thanks! Committed.
Cheers,
David
>
> *** EOAccess/EOSQLQualifier.m.old Sun Jul 19 12:18:00 2009
> --- EOAccess/EOSQLQualifier.m Tue Jul 21 12:23:32 2009
> ***************
> *** 58,63 ****
> --- 58,64 ----
> #include <EOAccess/EOJoin.h>
> #include <EOAccess/EOEntity.h>
> #include <EOAccess/EOSQLExpression.h>
> + #include <EOAccess/EOExpressionArray.h>
>
> #include <EOControl/EOQualifier.h>
> #include <EOControl/EOEditingContext.h>
> ***************
> *** 81,102 ****
> - (id)initWithEntity: (EOEntity *)entity
> qualifierFormat: (NSString *)qualifierFormat, ...
> {
> ! NSEmitTODO(); //TODO
> ! [self notImplemented: _cmd]; //TODO
>
> ! return nil;
> }
>
> - (EOQualifier *)schemaBasedQualifierWithRootEntity:(EOEntity *)
> entity
> {
> ! [self notImplemented: _cmd];
> ! return nil;
> }
>
> - (NSString *)sqlStringForSQLExpression:(EOSQLExpression *)
> sqlExpression
> {
> ! [self notImplemented: _cmd];
> ! return nil;
> }
>
> @end
> --- 82,124 ----
> - (id)initWithEntity: (EOEntity *)entity
> qualifierFormat: (NSString *)qualifierFormat, ...
> {
> ! va_list args;
> ! NSMutableString *sqlString;
>
> ! if(!entity)
> ! [NSException raise: NSInvalidArgumentException
> ! format: @"%@ -- %@ 0x%x: no entity specified",
> ! NSStringFromSelector(_cmd),
> ! NSStringFromClass([self class]),
> ! self];
> !
> ! ASSIGN(_entity, entity);
> !
> ! va_start (args, qualifierFormat);
> ! sqlString = [NSMutableString stringWithFormat:qualifierFormat
> arguments:args];
> ! va_end (args);
> !
> ! _contents = [[EOExpressionArray alloc] initWithPrefix:sqlString
> infix:nil suffix:nil];
> !
> ! return self;
> }
>
> - (EOQualifier *)schemaBasedQualifierWithRootEntity:(EOEntity *)
> entity
> {
> ! return self;
> }
>
> - (NSString *)sqlStringForSQLExpression:(EOSQLExpression *)
> sqlExpression
> {
> ! return [_contents expressionValueForContext:nil];
> ! }
> !
> ! - (void)dealloc
> ! {
> ! DESTROY(_entity);
> ! DESTROY(_contents);
> !
> ! [super dealloc];
> }
>
> @end
>
>
>
> _______________________________________________
> Bug-gnustep mailing list
> Bug-gnustep@gnu.org
> http://lists.gnu.org/mailman/listinfo/bug-gnustep
--
David Ayers Fellow of the Free Software Foundation Europe
http://www.fsfe.org http://fellowship.fsfe.org