4
Copyright (C) 1996 Free Software Foundation, Inc.
6
Author: Ovidiu Predescu <ovidiu@bx.logicnet.ro>
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.
30
#import <Foundation/NSString.h>
34
@interface EOModel : NSObject
38
NSString *adaptorName;
39
NSString *adaptorClassName;
40
NSDictionary *connectionDictionary;
41
NSDictionary *pkeyGeneratorDictionary;
42
NSDictionary *userDictionary;
44
NSArray *entities; // values with EOEntities
45
NSMutableDictionary *entitiesByName; // name/value with EOEntity
46
NSMutableDictionary *entitiesByClassName; // class name/value with EOEntity
49
BOOL createsMutableObjects:1;
54
/* Searching for a model file */
55
+ (NSString*)findPathForModelNamed:(NSString*)name;
57
/* Initializing instances */
58
- (id)initWithContentsOfFile:(NSString*)filename;
59
- (id)initWithPropertyList:propertyList;
60
- (id)initWithName:(NSString*)name;
62
/* Getting the filename */
65
/* Getting a property list representation */
66
- (id)modelAsPropertyList;
68
/* Getting the name */
72
- (BOOL)addEntity:(EOEntity *)entity;
73
- (void)removeEntityNamed:(NSString *)name;
74
- (EOEntity *)entityNamed:(NSString *)name;
75
- (NSArray *)entities;
77
/* Checking references */
78
- (NSArray *)referencesToProperty:(id)property;
80
/* Getting an object's entity */
81
- (EOEntity *)entityForObject:(id)object;
83
/* Adding model information */
84
- (BOOL)incorporateModel:(EOModel *)model;
86
/* Accessing the adaptor bundle */
87
- (void)setAdaptorName:(NSString *)adaptorName;
88
- (NSString *)adaptorName;
90
/* Setting and getting the adaptor class name. */
91
- (void)setAdaptorClassName:(NSString *)adaptorClassName;
92
- (NSString *)adaptorClassName;
94
/* Accessing the connection dictionary */
95
- (void)setConnectionDictionary:(NSDictionary *)connectionDictionary;
96
- (NSDictionary *)connectionDictionary;
98
/* Accessing the pkey generator dictionary */
99
- (void)setPkeyGeneratorDictionary:(NSDictionary *)connectionDictionary;
100
- (NSDictionary *)pkeyGeneratorDictionary;
102
/* Accessing the user dictionary */
103
- (void)setUserDictionary:(NSDictionary *)dictionary;
104
- (NSDictionary *)userDictionary;
109
@interface EOModel (EOModelPrivate)
111
- (void)setCreateMutableObjects:(BOOL)flag;
112
- (BOOL)createsMutableObjects;
114
- (void)errorInReading;
116
@end /* EOModel (EOModelPrivate) */
118
@interface EOModel(NewInEOF2)
120
- (void)loadAllModelObjects;
124
#endif /* __EOModel_h__ */