GNUstep Core Data  0.1
NSEntityDescription.h
1 /* Interface of the NSEntityDescription 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 _NSEntityDescription_h_
26 #define _NSEntityDescription_h_
27 
28 #import <Foundation/NSObject.h>
29 
30 @class NSString, NSArray, NSDictionary;
31 @class NSManagedObjectModel, NSManagedObjectContext;
32 
33 @interface NSEntityDescription : NSObject <NSCopying, NSCoding>
34 {
35  NSString * _name;
36  BOOL _abstract;
37  NSString * _managedObjectClassName;
38  NSArray * _properties;
39  NSDictionary * _userInfo;
40 
41  NSArray * _subentities;
42  // weak reference
43  NSEntityDescription * _superentity;
44 
45  // weak reference
46  NSManagedObjectModel * _model;
52  unsigned int _modelRefCount;
53 }
54 
55 // Convenience class methods.
56 + (NSEntityDescription *) entityForName: (NSString *) anEntityName
57  inManagedObjectContext: (NSManagedObjectContext *) aContext;
58 + (id) insertNewObjectForEntityForName: (NSString *) anEntityName
59  inManagedObjectContext: (NSManagedObjectContext *) aContext;
60 
61 - (NSDictionary *) attributesByName;
62 // - (id) copy;
63 - (BOOL) isAbstract;
64 - (NSString *) managedObjectClassName;
65 - (NSManagedObjectModel *) managedObjectModel;
66 - (NSString *) name;
67 - (NSArray *) properties;
68 - (NSDictionary *) propertiesByName;
69 - (NSDictionary *) relationshipsByName;
70 - (NSArray *) relationshipsWithDestinationEntity:(NSEntityDescription *) _destinationEntity;
71 - (void) setAbstract: (BOOL) flag;
72 - (void) setManagedObjectClassName: (NSString *) aClassName;
73 - (void) setName: (NSString *) aName;
74 - (void) setProperties: (NSArray *) someProperties;
75 - (void) setSubentities: (NSArray *) someSubentities;
76 - (void) setUserInfo: (NSDictionary *) someUserInfo;
77 - (NSArray *) subentities;
78 - (NSDictionary *) subentitiesByName;
79 - (NSEntityDescription *) superentity;
80 - (NSDictionary *) userInfo;
81 - (BOOL) _isSubentityOfEntity: (NSEntityDescription *) otherEntity;
82 
83 @end
84 
85 #endif // _NSEntityDescription_h_