GNUstep Core Data  0.1
NSRelationshipDescription.h
00001 /* Interface of the NSRelationshipDescription 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 _NSRelationshipDescription_h_
00026 #define _NSRelationshipDescription_h_
00027 
00028 #import <CoreData/NSPropertyDescription.h>
00029 
00030 typedef enum {
00031         NSNoActionDeleteRule,
00032         NSNullifyDeleteRule,
00033         NSCascadeDeleteRule,
00034         NSDenyDeleteRule
00035 } NSDeleteRule;
00036 
00037 @class NSEntityDescription;
00038 
00039 @interface NSRelationshipDescription : NSPropertyDescription
00040 {
00041   NSEntityDescription * _destinationEntity;
00042   NSDeleteRule _deleteRule;
00043    // weak reference
00044   NSRelationshipDescription * _inverseRelationship;
00045 
00046   int _minCount, _maxCount;
00047 }
00048 
00049 // Getting and setting the destination entity.
00050 - (NSEntityDescription *) destinationEntity;
00051 - (void) setDestinationEntity: (NSEntityDescription *) anEntityDescription;
00052 
00053 // Getting and setting the inverse relationship.
00054 - (NSRelationshipDescription *) inverseRelationship;
00055 - (void) setInverseRelationship: (NSRelationshipDescription *)
00056   aRelationshipDescription;
00057 
00058 // Getting and setting the delete rule.
00059 - (NSDeleteRule) deleteRule;
00060 - (void) setDeleteRule: (NSDeleteRule) aDeleteRule;
00061 
00062 // Controlling cardinality.
00063 - (int) minCount;
00064 - (void) setMinCount: (int) aCount;
00065 - (int) maxCount;
00066 - (void) setMaxCount: (int) aCount;
00067 - (BOOL) isToMany;
00068 
00069 @end
00070 
00071 #endif // _NSRelationshipDescription_h_