4 Copyright (C) SKYRIX Software AG and Helge Hess
6 Author: Helge Hess (helge.hess@opengroupware.org)
9 This file is part of the GNUstep Database Library.
11 This library is free software; you can redistribute it and/or
12 modify it under the terms of the GNU Library General Public
13 License as published by the Free Software Foundation; either
14 version 2 of the License, or (at your option) any later version.
16 This library is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Library General Public License for more details.
21 You should have received a copy of the GNU Library General Public
22 License along with this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 // $Id: EOAdaptorDataSource.h 1 2004-08-20 10:38:46Z znek $
28 #ifndef __EOAdaptorDataSource_h__
29 #define __EOAdaptorDataSource_h__
31 #import <EOControl/EODataSource.h>
33 @class NSArray, NSDictionary;
34 @class EOFetchSpecification, EOAdaptorChannel, EOQualifier;
37 Fetch dictionaries from database tables.
38 The tablename has to be set in [FetchSpecification entityName].
39 Qualifier, sortOrdering, distinct will be evaluated.
40 It handles now tables with more than one primary key.
41 Its possible to set the primary key in the fetchspecification hints
42 (EOPrimaryKeyAttributeNamesHint -> array with strings as columnnames
43 for the PKeys; EOPrimaryKeyAttributesHint -> array with EOAttributes for
45 If no primary key is set, and now primary key could find in the table
46 schema, all keys will be taken as primary keys.
47 If only one primary key exsist, in insert object a new key will be generatet,
48 else all keys has to be set.
49 If fetch hint EOFetchResultTimeZone is set (NSTimeZone), this timezone will
50 be set in date objectes.
53 extern NSString *EOPrimaryKeyAttributeNamesHint;
54 extern NSString *EOPrimaryKeyAttributesHint;
55 extern NSString *EOFetchResultTimeZone;
57 @interface EOAdaptorDataSource : EODataSource
60 EOFetchSpecification *fetchSpecification;
62 EOAdaptorChannel *adChannel;
63 EOQualifier *__qualifier;
64 NSArray *__attributes;
65 BOOL commitTransaction;
66 NSDictionary *connectionDictionary;
69 - (id)initWithAdaptorChannel:(EOAdaptorChannel *)_channel;
71 - (id)initWithAdaptorChannel:(EOAdaptorChannel *)_channel
72 connectionDictionary:(NSDictionary *)_connDict;
74 - (id)initWithAdaptorName:(NSString *)_adName
75 connectionDictionary:(NSDictionary *)_dict
76 primaryKeyGenerationDictionary:(NSDictionary *)_pkGen;
80 Returns an array with dictionaries, who contains key/values from the
81 entity (use entityName/qualifier/sortOrdering).
82 Also it contains an key named 'globalID'. If EOAdaptorDataSource is
83 initialized with initWithAdaptorChannel the globaID is an EOKeyGlobalID
84 else if it is initialized with initWithAdaptorName the globalID is and
87 - (NSArray *)fetchObjects;
90 returns an mutable dictionary
94 - (void)insertObject:(id)_obj;
95 - (void)deleteObject:(id)_obj;
96 - (void)updateObject:(id)_obj;
98 - (void)setFetchSpecification:(EOFetchSpecification *)_fs;
99 - (EOFetchSpecification *)fetchSpecification;
102 - (EOAdaptorChannel *)beginTransaction;
103 - (void)commitTransaction;
104 - (void)rollbackTransaction;
107 - (void)closeChannel;
110 #endif /* __EOAdaptorDataSource_h__ */