4 Copyright (C) 1996 Free Software Foundation, Inc.
6 Author: Ovidiu Predescu <ovidiu@bx.logicnet.ro>
9 This file is part of the GNUstep Database Library.
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.
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.
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.
28 #import "EOFExceptions.h"
30 #import "EORelationship.h"
32 @implementation EOFException
33 @end /* EOFException */
36 @implementation ObjectNotAvailableException
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]];
43 [self initWithName:@"NSObjectNotAvailableException"
44 reason:_reason userInfo:nil];
48 @end /* ObjectNotAvailableException */
51 @implementation PropertyDefinitionException
52 @end /* PropertyDefinitionException */
55 @implementation DestinationEntityDoesntMatchDefinitionException
57 - initForDestination:(EOEntity*)destinationEntity
58 andDefinition:(NSString*)definition
59 relationship:(EORelationship*)relationship
61 id _reason = [NSString stringWithFormat:@"destination entity '%@' does not"
62 @" match definition '%@' in relationship '%@'",
63 [destinationEntity name],
66 [self initWithName:NSStringFromClass(isa)
67 reason:_reason userInfo:nil];
70 @end /* DestinationEntityDoesntMatchDefinitionException */
73 @implementation InvalidNameException
74 - initWithName:(NSString*)_name
76 id _reason = [NSString stringWithFormat:@"invalid name: '%@'", _name];
77 [self initWithName:NSStringFromClass(isa) reason:_reason userInfo:nil];
80 @end /* InvalidNameException */
83 @implementation InvalidPropertyException
84 - initWithName:propertyName entity:currentEntity
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];
93 @end /* InvalidPropertyException */
96 @implementation RelationshipMustBeToOneException
97 - initWithName:propertyName entity:currentEntity
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];
106 @end /* RelationshipMustBeToOneException */
109 @implementation InvalidValueTypeException
112 id _reason = [NSString stringWithFormat:@"unknow value type '%@'", type];
113 [self initWithName:@"InvalidValueTypeException"
114 reason:_reason userInfo:nil];
120 @implementation InvalidAttributeException
121 @end /* InvalidAttributeException */
124 @implementation InvalidQualifierException
125 @end /* InvalidQualifierException */
128 @implementation EOAdaptorException
129 @end /* EOAdaptorException */
132 @implementation CannotFindAdaptorBundleException
133 @end /* CannotFindAdaptorBundleException */
136 @implementation InvalidAdaptorBundleException
137 @end /* InvalidAdaptorBundleException */
140 @implementation InvalidAdaptorStateException
141 + exceptionWithAdaptor:(id)_adaptor
143 InvalidAdaptorStateException* exception = [self alloc];
144 exception->adaptor = _adaptor;
147 @end /* InvalidAdaptorStateException */
150 @implementation DataTypeMappingNotSupportedException
151 @end /* DataTypeMappingNotSupportedException */
154 @implementation ChannelIsNotOpenedException
155 @end /* ChannelIsNotOpenedException */
158 @implementation AdaptorIsFetchingException
159 @end /* AdaptorIsFetchingException */
162 @implementation AdaptorIsNotFetchingException
163 @end /* AdaptorIsNotFetchingException */
166 @implementation NoTransactionInProgressException
167 @end /* NoTransactionInProgressException */
170 @implementation TooManyOpenedChannelsException
171 @end /* TooManyOpenedChannelsException */