2 PostgreSQL72Expression.m
4 Copyright (C) 1999 MDlink online service center GmbH and Helge Hess
5 Copyright (C) 2000-2006 SKYRIX Software AG and Helge Hess
7 Author: Helge Hess (helge@opengroupware.org)
9 This file is part of the PostgreSQL Adaptor 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.
27 #include "PostgreSQL72Expression.h"
30 @implementation PostgreSQL72Expression
32 + (Class)selectExpressionClass {
33 return [PostgreSQL72SelectSQLExpression class];
36 @end /* PostgreSQL72Expression */
38 @implementation PostgreSQL72SelectSQLExpression
40 - (id)selectExpressionForAttributes:(NSArray *)attributes
42 qualifier:(EOSQLQualifier *)qualifier
43 fetchOrder:(NSArray *)fetchOrder
44 channel:(EOAdaptorChannel *)channel {
47 [super selectExpressionForAttributes:attributes
55 - (NSString *)fromClause {
56 NSMutableString *fromClause;
57 NSEnumerator *enumerator;
61 fromClause = [NSMutableString stringWithCapacity:64];
62 enumerator = [fromListEntities objectEnumerator];
64 [fromClause appendString:@" "];
66 // Compute the FROM list from all the aliases found in
67 // entitiesAndPropertiesAliases dictionary. Note that this dictionary
68 // contains entities and relationships. The last ones are there for
69 // flattened attributes over reflexive relationships.
71 while ((key = [enumerator nextObject]) != nil) {
73 else [fromClause appendString:@", "];
75 [fromClause appendString:
76 [key isKindOfClass:[EORelationship class]]
77 ? [[key destinationEntity] externalName]
78 // flattened attribute
79 : [key externalName]];
82 [fromClause appendString:@" "];
83 [fromClause appendString:
84 [[entitiesAndPropertiesAliases objectForKey:key] stringValue]];
87 if (lock) [fromClause appendString:@" HOLDLOCK"];
96 void __link_PostgreSQL72Expression() {
97 // used to force linking of object file
98 __link_PostgreSQL72Expression();