GNUstep Core Data 0.1
NSRelationshipDescription.h
1/* Interface of the NSRelationshipDescription 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 _NSRelationshipDescription_h_
26#define _NSRelationshipDescription_h_
27
28#import <CoreData/NSPropertyDescription.h>
29
30typedef enum {
31 NSNoActionDeleteRule,
32 NSNullifyDeleteRule,
33 NSCascadeDeleteRule,
34 NSDenyDeleteRule
35} NSDeleteRule;
36
37@class NSEntityDescription;
38
39@interface NSRelationshipDescription : NSPropertyDescription
40{
41 NSEntityDescription * _destinationEntity;
42 NSDeleteRule _deleteRule;
43 // weak reference
44 NSRelationshipDescription * _inverseRelationship;
45
46 int _minCount, _maxCount;
47}
48
49// Getting and setting the destination entity.
50- (NSEntityDescription *) destinationEntity;
51- (void) setDestinationEntity: (NSEntityDescription *) anEntityDescription;
52
53// Getting and setting the inverse relationship.
54- (NSRelationshipDescription *) inverseRelationship;
55- (void) setInverseRelationship: (NSRelationshipDescription *)
56 aRelationshipDescription;
57
58// Getting and setting the delete rule.
59- (NSDeleteRule) deleteRule;
60- (void) setDeleteRule: (NSDeleteRule) aDeleteRule;
61
62// Controlling cardinality.
63- (int) minCount;
64- (void) setMinCount: (int) aCount;
65- (int) maxCount;
66- (void) setMaxCount: (int) aCount;
67- (BOOL) isToMany;
68
69@end
70
71#endif // _NSRelationshipDescription_h_