]> err.no Git - sope/blob - sope-gdl1/GDLAccess/EOFExceptions.m
fixed bug in GDL adaptor lookup
[sope] / sope-gdl1 / GDLAccess / EOFExceptions.m
1 /* 
2    EOFExceptions.m
3
4    Copyright (C) 1996 Free Software Foundation, Inc.
5
6    Author: Ovidiu Predescu <ovidiu@bx.logicnet.ro>
7    Date: August 1996
8
9    This file is part of the GNUstep Database Library.
10
11    This library is free software; you can redistribute it and/or
12    modify it under the terms of the GNU Library General Public
13    License as published by the Free Software Foundation; either
14    version 2 of the License, or (at your option) any later version.
15
16    This library is distributed in the hope that it will be useful,
17    but WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19    Library General Public License for more details.
20
21    You should have received a copy of the GNU Library General Public
22    License along with this library; see the file COPYING.LIB.
23    If not, write to the Free Software Foundation,
24    59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 */
26
27 #import "common.h"
28 #import "EOFExceptions.h"
29 #import "EOEntity.h"
30 #import "EORelationship.h"
31
32 @implementation EOFException
33 @end /* EOFException */
34
35
36 @implementation ObjectNotAvailableException
37
38 - initWithEntity:entity andPrimaryKey:key {
39     id _reason = [NSString stringWithFormat:@"A to-one relation could not be "
40                             @"resolved for entity %@ and primary key %@",
41                             [(EOEntity*)entity name], [key description]];
42
43     [self initWithName:@"NSObjectNotAvailableException"
44                     reason:_reason userInfo:nil];
45     return self;
46 }
47
48 @end /* ObjectNotAvailableException */
49
50
51 @implementation PropertyDefinitionException
52 @end /* PropertyDefinitionException */
53
54
55 @implementation DestinationEntityDoesntMatchDefinitionException
56
57 - initForDestination:(EOEntity*)destinationEntity
58   andDefinition:(NSString*)definition
59   relationship:(EORelationship*)relationship
60 {
61     id _reason = [NSString stringWithFormat:@"destination entity '%@' does not"
62                             @" match definition '%@' in relationship '%@'",
63                             [destinationEntity name],
64                             definition,
65                             [relationship name]];
66     [self initWithName:NSStringFromClass(isa)
67             reason:_reason userInfo:nil];
68     return self;
69 }
70 @end /* DestinationEntityDoesntMatchDefinitionException */
71
72
73 @implementation InvalidNameException
74 - initWithName:(NSString*)_name
75 {
76     id _reason = [NSString stringWithFormat:@"invalid name: '%@'", _name];
77     [self initWithName:NSStringFromClass(isa) reason:_reason userInfo:nil];
78     return self;
79 }
80 @end /* InvalidNameException */
81
82
83 @implementation InvalidPropertyException
84 - initWithName:propertyName entity:currentEntity
85 {
86     id _reason = [NSString stringWithFormat:@"property '%@' does not exist in "
87                             @"entity '%@'", propertyName,
88                             [(EOEntity*)currentEntity name]];
89     [self initWithName:NSStringFromClass(isa)
90             reason:_reason userInfo:nil];
91     return self;
92 }
93 @end /* InvalidPropertyException */
94
95
96 @implementation RelationshipMustBeToOneException
97 - initWithName:propertyName entity:currentEntity
98 {
99     id _reason = [NSString stringWithFormat:@"property '%@' must be to one in "
100                     @"entity '%@' to allow flattened attribute",
101                     propertyName, [(EOEntity*)currentEntity name]];
102     [self initWithName:NSStringFromClass(isa)
103             reason:_reason userInfo:nil];
104     return self;
105 }
106 @end /* RelationshipMustBeToOneException */
107
108
109 @implementation InvalidValueTypeException
110 - initWithType:type
111 {
112     id _reason = [NSString stringWithFormat:@"unknow value type '%@'", type];
113     [self initWithName:@"InvalidValueTypeException"
114             reason:_reason userInfo:nil];
115     return self;
116 }
117 @end
118
119
120 @implementation InvalidAttributeException
121 @end /* InvalidAttributeException */
122
123
124 @implementation InvalidQualifierException
125 @end /* InvalidQualifierException */
126
127
128 @implementation EOAdaptorException
129 @end /* EOAdaptorException */
130
131
132 @implementation CannotFindAdaptorBundleException
133 @end /* CannotFindAdaptorBundleException */
134
135
136 @implementation InvalidAdaptorBundleException
137 @end /* InvalidAdaptorBundleException */
138
139
140 @implementation InvalidAdaptorStateException
141 + exceptionWithAdaptor:(id)_adaptor
142 {
143     InvalidAdaptorStateException* exception = [self alloc];
144     exception->adaptor = _adaptor;
145     return exception;
146 }
147 @end /* InvalidAdaptorStateException */
148
149
150 @implementation DataTypeMappingNotSupportedException
151 @end /* DataTypeMappingNotSupportedException */
152
153
154 @implementation ChannelIsNotOpenedException
155 @end /* ChannelIsNotOpenedException */
156
157
158 @implementation AdaptorIsFetchingException
159 @end /* AdaptorIsFetchingException */
160
161
162 @implementation AdaptorIsNotFetchingException
163 @end /* AdaptorIsNotFetchingException */
164
165
166 @implementation NoTransactionInProgressException
167 @end /* NoTransactionInProgressException */
168
169
170 @implementation TooManyOpenedChannelsException
171 @end /* TooManyOpenedChannelsException */