GNUstep Core Data  0.1
NSManagedObjectModel.h
1 /* Interface of the NSManagedObjectModel class for the GNUstep
2  Core Data framework.
3  Copyright (C) 2005 Free Software Foundation, Inc.
4 
5  Written by: Saso Kiselkov <diablos@manga.sk>
6  Date: August 2005
7 
8  This file is part of the GNUstep Core Data framework.
9 
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Lesser General Public
12  License as published by the Free Software Foundation; either
13  version 2.1 of the License, or (at your option) any later version.
14 
15  This library is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public
21  License along with this library; if not, write to the Free
22  Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
23  */
24 
25 #ifndef _NSManagedObjectModel_h_
26 #define _NSManagedObjectModel_h_
27 
28 #import <Foundation/NSObject.h>
29 
30 @class NSString, NSArray, NSDictionary, NSMutableDictionary, NSURL;
31 @class NSFetchRequest, NSAttributeDescription;
32 
33 @interface NSManagedObjectModel : NSObject <NSCopying, NSCoding>
34 {
35  NSArray * _entities;
36 
41  NSMutableDictionary * _configurations;
42  NSMutableDictionary * _fetchRequests;
43 
44  NSMutableDictionary * _defaultAttributeValues;
45 
54  unsigned _usedByPersistentStoreCoordinators;
55 }
56 
57 // Initialization.
58 + (NSManagedObjectModel *) mergedModelFromBundles: (NSArray *) someBundles;
59 + (NSManagedObjectModel *) modelByMergingModels: (NSArray *) someModels;
60 - initWithContentsOfURL: (NSURL *) aUrl;
61 
62 // Getting and setting entities and configurations.
63 - (NSArray *) entities;
64 - (NSDictionary *) entitiesByName;
65 - (void) setEntities: (NSArray *) someEntities;
66 - (NSArray *) configurations;
67 - (NSArray *) entitiesForConfiguration: (NSString *) aConfiguration;
68 // passing `nil' as the entities instead deletes the configuration
69 - (void) setEntities: (NSArray *) someEntities
70  forConfiguration: (NSString *) aConfiguration;
71 
72 // Getting and setting fetch request templates.
73 - (NSFetchRequest *) fetchRequestTemplateForName: (NSString *) aName;
74 - (NSFetchRequest *) fetchRequestFromTemplateWithName: (NSString *) aName
75  substitutionVariables: (NSDictionary *) someVariables;
76 - (void) setFetchRequestTemplate: (NSFetchRequest *) aFetchRequest
77  forName: (NSString *) aName;
78 
79 // Localization.
80 - (NSDictionary *) localizationDictionary;
81 - (void) setLocalizationDictionary: (NSDictionary *) aLocalizationDictionary;
82 
83 @end
84 
85 #endif // _NSManagedObjectModel_h_
An object for storing details about managed object fetches.