- (BOOL)deleteRowsDescribedByQualifier:(EOSQLQualifier *)aQualifier;
/* Fetching rows */
-- (BOOL)selectAttributes:(NSArray*)attributes
- describedByQualifier:(EOSQLQualifier*)aQualifier
- fetchOrder:(NSArray*)aFetchOrder
+- (BOOL)selectAttributes:(NSArray *)attributes
+ describedByQualifier:(EOSQLQualifier *)aQualifier
+ fetchOrder:(NSArray *)aFetchOrder
+ lock:(BOOL)aLockFlag;
+- (NSException *)selectAttributesX:(NSArray *)attributes
+ describedByQualifier:(EOSQLQualifier *)aQualifier
+ fetchOrder:(NSArray *)aFetchOrder
lock:(BOOL)aLockFlag;
- (NSArray*)describeResults; // override
-- (NSMutableDictionary*)fetchAttributes:(NSArray*)attributes
- withZone:(NSZone*)zone;
+- (NSMutableDictionary*)fetchAttributes:(NSArray *)attributes
+ withZone:(NSZone *)zone;
- (BOOL)isFetchInProgress;
- (void)cancelFetch; // override
-- (NSMutableDictionary*)dictionaryWithObjects:(id*)objects
- forAttributes:(NSArray*)attributes zone:(NSZone*)zone;
-- (NSMutableDictionary*)primaryFetchAttributes:(NSArray*)attributes
- withZone:(NSZone*)zone; // override
+- (NSMutableDictionary *)dictionaryWithObjects:(id *)objects
+ forAttributes:(NSArray *)attributes zone:(NSZone *)zone;
+- (NSMutableDictionary *)primaryFetchAttributes:(NSArray *)attributes
+ withZone:(NSZone *)zone; // override
/* Sending SQL to the server */
- (BOOL)evaluateExpression:(NSString *)_anExpression; // override
if (!isOpen)
return [[ChannelIsNotOpenedException new] autorelease];
-
- if((row == nil) || (entity == nil)) {
+
+ if ((row == nil) || (entity == nil)) {
return [NSException exceptionWithName:NSInvalidArgumentException
reason:@"row and entity arguments for "
@"insertRow:forEntity: must not be the nil object"
userInfo:nil];
}
- if([self isFetchInProgress])
+ if ([self isFetchInProgress])
return [AdaptorIsFetchingException exceptionWithAdaptor:self];
if ([self->adaptorContext transactionNestingLevel] == 0)
/* compatibility methods (DEPRECATED, use the ...X methods */
+- (BOOL)selectAttributes:(NSArray *)attributes
+ describedByQualifier:(EOSQLQualifier *)qualifier
+ fetchOrder:(NSArray *)fetchOrder
+ lock:(BOOL)lockFlag
+{
+ NSException *ex;
+
+ ex = [self selectAttributesX:attributes describedByQualifier:qualifier
+ fetchOrder:fetchOrder lock:lockFlag];
+ if (ex == nil)
+ return YES;
+ if ([self _isNoRaiseOnModificationException:ex])
+ return NO;
+ [ex raise];
+ return NO;
+}
+
- (BOOL)insertRow:(NSDictionary *)_row forEntity:(EOEntity *)_entity {
NSException *ex;
/* fetch operations */
-- (BOOL)selectAttributes:(NSArray *)attributes
+- (NSException *)selectAttributesX:(NSArray *)attributes
describedByQualifier:(EOSQLQualifier *)qualifier
fetchOrder:(NSArray *)fetchOrder
lock:(BOOL)lockFlag
{
- EOSQLExpression *sqlexpr = nil;
- NSMutableArray *mattrs = (NSMutableArray *)attributes;
- NSMutableArray *mfetch = (NSMutableArray *)fetchOrder;
-
- if (!isOpen)
- [[ChannelIsNotOpenedException new] raise];
-
- if (attributes == nil) {
- [NSException raise:NSInvalidArgumentException
- format:@"attributes argument for selectAttributes:"
- @"describedByQualifier:fetchOrder:lock: "
- @"must not be the nil object"];
- }
+ NSException *ex;
+ EOSQLExpression *sqlexpr = nil;
+ NSMutableArray *mattrs = (NSMutableArray *)attributes;
+ NSMutableArray *mfetch = (NSMutableArray *)fetchOrder;
- if ([self isFetchInProgress])
- [[AdaptorIsFetchingException exceptionWithAdaptor:self] raise];
-
- if ([self->adaptorContext transactionNestingLevel] == 0)
- [[NoTransactionInProgressException exceptionWithAdaptor:self] raise];
+ if (!isOpen)
+ return [[ChannelIsNotOpenedException new] autorelease];
- if(delegateRespondsTo.willSelectAttributes) {
- EODelegateResponse response;
+ if (attributes == nil) {
+ return [NSException exceptionWithName:NSInvalidArgumentException
+ reason:
+ @"attributes argument for selectAttributes:"
+ @"describedByQualifier:fetchOrder:lock: "
+ @"must not be the nil object"
+ userInfo:nil];
+ }
+
+ if ([self isFetchInProgress])
+ return [AdaptorIsFetchingException exceptionWithAdaptor:self];
+
+ if ([self->adaptorContext transactionNestingLevel] == 0)
+ return [NoTransactionInProgressException exceptionWithAdaptor:self];
+
+ if (delegateRespondsTo.willSelectAttributes) {
+ EODelegateResponse response;
- mattrs = [[attributes mutableCopy] autorelease];
- mfetch = [[fetchOrder mutableCopy] autorelease];
-
- response = [delegate adaptorChannel:self
- willSelectAttributes:mattrs
- describedByQualifier:qualifier
- fetchOrder:mfetch
- lock:lockFlag];
- if (response == EODelegateRejects)
- return NO;
- if (response == EODelegateOverrides)
- return YES;
+ mattrs = [[attributes mutableCopy] autorelease];
+ mfetch = [[fetchOrder mutableCopy] autorelease];
+
+ response = [delegate adaptorChannel:self
+ willSelectAttributes:mattrs
+ describedByQualifier:qualifier
+ fetchOrder:mfetch
+ lock:lockFlag];
+ if (response == EODelegateRejects) {
+ return [NSException exceptionWithName:@"EODelegateRejects"
+ reason:@"delegate rejected select"
+ userInfo:nil];
}
+ if (response == EODelegateOverrides)
+ return nil;
+ }
#if 0
#warning DEBUG LOG, REMOVE!
- [self logWithFormat:@"fetch qualifier: %@", qualifier];
+ [self logWithFormat:@"fetch qualifier: %@", qualifier];
#endif
- sqlexpr = [[[self->adaptorContext adaptor]
+ sqlexpr = [[[self->adaptorContext adaptor]
expressionClass]
selectExpressionForAttributes:attributes
lock:lockFlag
fetchOrder:fetchOrder
channel:self];
- if (![self evaluateExpression:[sqlexpr expressionValueForContext:nil]])
- return NO;
-
- if (delegateRespondsTo.didSelectAttributes) {
- [delegate adaptorChannel:self
- didSelectAttributes:mattrs
- describedByQualifier:qualifier
- fetchOrder:mfetch
- lock:lockFlag];
- }
-
- return YES;
+ ex = [self evaluateExpressionX:[sqlexpr expressionValueForContext:nil]];
+ if (ex != nil)
+ return ex;
+
+ if (delegateRespondsTo.didSelectAttributes) {
+ [delegate adaptorChannel:self
+ didSelectAttributes:mattrs
+ describedByQualifier:qualifier
+ fetchOrder:mfetch
+ lock:lockFlag];
+ }
+ return nil;
}
- (NSArray *)describeResults {
-# $Id: README 1 2004-08-20 10:38:46Z znek $
-
-NOTE: this file is heavily outdated
+NOTE: this file is outdated!
GNU Database Library Access Layer - MDlink patch Version
- Contained code is derived from gdl - GNU Database Library and is therefore
- LGPL license. Copyright for gdl has the Free Software Foundation.
+ Contained code is derived from GDL - GNU Database Library and is therefore
+ LGPL license. Copyright for GDL has the Free Software Foundation.
Changes
- There are no EOJoin's anymore (only for compability). EORelationships cannot
- be compound and store source and destination themselves.
+ There are no EOJoin's anymore (only for compability). EORelationships
+ cannot be compound and store source and destination themselves.
No compound primary keys are allowed.
Uniquing is always enabled.
+ Added "abcX" methods which do not raise exceptions but return them.
+
Static Linking
uncomment '#imports' in EOModel.m