]> err.no Git - sope/blob - sope-gdl1/GDLAccess/EOAdaptorDataSource.h
added missing inline pathes
[sope] / sope-gdl1 / GDLAccess / EOAdaptorDataSource.h
1 /* 
2    EOAdaptorDataSource.h
3    
4    Copyright (C) SKYRIX Software AG and Helge Hess
5
6    Author: Helge Hess (helge.hess@opengroupware.org)
7    Date:   1999-2004
8
9    This file is part of the GNUstep Database Library.
10
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.
15
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.
20
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.
25 */
26 // $Id: EOAdaptorDataSource.h 1 2004-08-20 10:38:46Z znek $
27
28 #ifndef __EOAdaptorDataSource_h__
29 #define __EOAdaptorDataSource_h__
30
31 #import <EOControl/EODataSource.h>
32
33 @class NSArray, NSDictionary;
34 @class EOFetchSpecification, EOAdaptorChannel, EOQualifier;
35
36 /*
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
44   the PKeys).
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.
51 */
52
53 extern NSString *EOPrimaryKeyAttributeNamesHint;
54 extern NSString *EOPrimaryKeyAttributesHint;
55 extern NSString *EOFetchResultTimeZone;
56
57 @interface EOAdaptorDataSource : EODataSource
58 {
59 @private
60   EOFetchSpecification *fetchSpecification;
61 @protected
62   EOAdaptorChannel     *adChannel;
63   EOQualifier          *__qualifier;
64   NSArray              *__attributes;
65   BOOL                 commitTransaction;
66   NSDictionary         *connectionDictionary;
67 }
68
69 - (id)initWithAdaptorChannel:(EOAdaptorChannel *)_channel;
70
71 - (id)initWithAdaptorChannel:(EOAdaptorChannel *)_channel
72   connectionDictionary:(NSDictionary *)_connDict;
73
74 - (id)initWithAdaptorName:(NSString *)_adName
75   connectionDictionary:(NSDictionary *)_dict
76   primaryKeyGenerationDictionary:(NSDictionary *)_pkGen;  
77
78
79 /*
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
85   EOAdaptorGlobalID.
86 */
87 - (NSArray *)fetchObjects;
88
89 /*
90   returns an mutable dictionary 
91 */
92 - (id)createObject;
93
94 - (void)insertObject:(id)_obj;
95 - (void)deleteObject:(id)_obj;
96 - (void)updateObject:(id)_obj;
97  
98 - (void)setFetchSpecification:(EOFetchSpecification *)_fs;
99 - (EOFetchSpecification *)fetchSpecification;
100
101 /* for subclasses */
102 - (EOAdaptorChannel *)beginTransaction;
103 - (void)commitTransaction;
104 - (void)rollbackTransaction;
105
106 - (void)openChannel;
107 - (void)closeChannel;
108 @end
109
110 #endif /* __EOAdaptorDataSource_h__ */