1 // $Id: EOModelGroup.h 1 2004-08-20 10:38:46Z znek $
3 #ifndef __EOAccess_EOModelGroup_H__
4 #define __EOAccess_EOModelGroup_H__
6 #import <Foundation/NSObject.h>
9 @class EOGlobalID, EOFetchSpecification;
10 @class EOModelGroup, EOModel, EOEntity, EORelationship;
12 @protocol EOModelGroupClassDelegation < NSObject >
14 - (EOModelGroup *)defaultModelGroup;
18 @protocol EOModelGroupDelegation < NSObject >
20 - (Class)entity:(EOEntity *)_entity
21 classForObjectWithGlobalID:(EOGlobalID *)_oid;
23 - (Class)entity:(EOEntity *)_entity
24 failedToLookupClassNamed:(NSString *)_className;
26 - (EOEntity *)relationship:(EORelationship *)_relship
27 failedToLookupDestinationNamed:(NSString *)_entityName;
29 - (EOEntity *)subEntityForEntity:(EOEntity *)_entity
30 primaryKey:(NSDictionary *)_pkey
31 isFinal:(BOOL *)_flag;
33 - (EOModel *)modelGroup:(EOModelGroup *)_group
34 entityNamed:(NSString *)_name;
36 - (EORelationship *)entity:(EOEntity *)_entity
37 relationshipForRow:(NSDictionary *)_row
38 relationship:(EORelationship *)_relship;
42 @class NSArray, NSMutableDictionary;
44 @interface EOModelGroup : NSObject
46 NSMutableDictionary *nameToModel;
47 id<EOModelGroupDelegation> delegate; /* non-retained */
50 + (void)setDefaultGroup:(EOModelGroup *)_group;
51 + (EOModelGroup *)defaultGroup;
53 + (EOModelGroup *)globalModelGroup;
57 + (void)setClassDelegate:(id<EOModelGroupClassDelegation>)_delegate;
58 + (id<EOModelGroupClassDelegation>)classDelegate;
60 /* instance delegate */
62 - (void)setDelegate:(id<EOModelGroupDelegation>)_delegate;
63 - (id<EOModelGroupDelegation>)delegate;
67 - (void)addModel:(EOModel *)_model;
68 - (void)removeModel:(EOModel *)_model;
70 - (EOModel *)modelNamed:(NSString *)_name;
71 - (NSArray *)modelNames;
73 - (EOModel *)modelWithPath:(NSString *)_path;
74 - (EOModel *)addModelWithFile:(NSString *)_path;
76 - (void)loadAllModelObjects;
80 - (EOEntity *)entityForObject:(id)_object;
81 - (EOEntity *)entityNamed:(NSString *)_name;
83 - (EOFetchSpecification *)fetchSpecificationNamed:(NSString *)_name
84 entityNamed:(NSString *)_entityName;
88 #endif /* __EOAccess_EOModelGroup_H__ */