GNUstep Core Data  0.1
NSEntityDescription.h
00001 /* Interface of the NSEntityDescription class for the GNUstep
00002    Core Data framework.
00003    Copyright (C) 2005 Free Software Foundation, Inc.
00004 
00005    Written by:  Saso Kiselkov <diablos@manga.sk>
00006    Date: August 2005
00007 
00008    This file is part of the GNUstep Core Data framework.
00009 
00010    This library is free software; you can redistribute it and/or
00011    modify it under the terms of the GNU Lesser General Public
00012    License as published by the Free Software Foundation; either
00013    version 2.1 of the License, or (at your option) any later version.
00014 
00015    This library is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018    Lesser General Public License for more details.
00019 
00020    You should have received a copy of the GNU Lesser General Public
00021    License along with this library; if not, write to the Free
00022    Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
00023  */
00024 
00025 #ifndef _NSEntityDescription_h_
00026 #define _NSEntityDescription_h_
00027 
00028 #import <Foundation/NSObject.h>
00029 
00030 @class NSString, NSArray, NSDictionary;
00031 @class NSManagedObjectModel, NSManagedObjectContext;
00032 
00033 @interface NSEntityDescription : NSObject <NSCopying, NSCoding>
00034 {
00035   NSString * _name;
00036   BOOL _abstract;
00037   NSString * _managedObjectClassName;
00038   NSArray * _properties;
00039   NSDictionary * _userInfo;
00040 
00041   NSArray * _subentities;
00042   // weak reference
00043   NSEntityDescription * _superentity;
00044 
00045   // weak reference
00046   NSManagedObjectModel * _model;
00052   unsigned int _modelRefCount;
00053 }
00054 
00055 // Convenience class methods.
00056 + (NSEntityDescription *) entityForName: (NSString *) anEntityName
00057                  inManagedObjectContext: (NSManagedObjectContext *) aContext;
00058 + (id) insertNewObjectForEntityForName: (NSString *) anEntityName
00059                 inManagedObjectContext: (NSManagedObjectContext *) aContext;
00060 
00061 - (NSDictionary *) attributesByName;
00062 // - (id) copy;
00063 - (BOOL) isAbstract;
00064 - (NSString *) managedObjectClassName;
00065 - (NSManagedObjectModel *) managedObjectModel;
00066 - (NSString *) name;
00067 - (NSArray *) properties;
00068 - (NSDictionary *) propertiesByName;
00069 - (NSDictionary *) relationshipsByName;
00070 - (NSArray *) relationshipsWithDestinationEntity:(NSEntityDescription *) _destinationEntity;
00071 - (void) setAbstract: (BOOL) flag;
00072 - (void) setManagedObjectClassName: (NSString *) aClassName;
00073 - (void) setName: (NSString *) aName;
00074 - (void) setProperties: (NSArray *) someProperties;
00075 - (void) setSubentities: (NSArray *) someSubentities;
00076 - (void) setUserInfo: (NSDictionary *) someUserInfo;
00077 - (NSArray *) subentities;
00078 - (NSDictionary *) subentitiesByName;
00079 - (NSEntityDescription *) superentity;
00080 - (NSDictionary *) userInfo;
00081 - (BOOL) _isSubentityOfEntity: (NSEntityDescription *) otherEntity;
00082 
00083 @end
00084 
00085 #endif // _NSEntityDescription_h_