From: helge Date: Thu, 4 Aug 2005 15:30:46 +0000 (+0000) Subject: added EO like model methods X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fd920d600cbde0b6307b111f43561d4ab2d547d;p=sope added EO like model methods git-svn-id: http://svn.opengroupware.org/SOPE/trunk@970 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-core/EOCoreData/ChangeLog b/sope-core/EOCoreData/ChangeLog index 27c2ab7b..ebecd628 100644 --- a/sope-core/EOCoreData/ChangeLog +++ b/sope-core/EOCoreData/ChangeLog @@ -1,3 +1,8 @@ +2005-08-04 Helge Hess + + * NSEntityDescription+EO.m: added EO compatible attribute/relship + lookup methods (v4.5.6) + 2005-08-04 Helge Hess * NSPredicate+EO.m: also check 'selectorName' key during unarchiving diff --git a/sope-core/EOCoreData/GNUmakefile b/sope-core/EOCoreData/GNUmakefile index 94667d16..9834c46b 100644 --- a/sope-core/EOCoreData/GNUmakefile +++ b/sope-core/EOCoreData/GNUmakefile @@ -14,23 +14,28 @@ libEOCoreData_HEADER_FILES_INSTALL_DIR = /EOCoreData libEOCoreData_HEADER_FILES = \ EOCoreData.h \ EOCoreDataSource.h \ + \ EOFetchSpecification+CoreData.h \ EOQualifier+CoreData.h \ EOSortOrdering+CoreData.h \ + \ NSExpression+EO.h \ NSPredicate+EO.h \ + NSEntityDescription+EO.h \ libEOCoreData_OBJC_FILES = \ EOCoreDataSource.m \ + \ EOFetchSpecification+CoreData.m \ EOQualifier+CoreData.m \ EOSortOrdering+CoreData.m \ - NSExpression+EO.m \ - NSPredicate+EO.m \ EOKeyValueQualifier+CoreData.m \ EOKeyComparisonQualifier+CoreData.m \ EOCompoundQualifiers.m \ - + \ + NSExpression+EO.m \ + NSPredicate+EO.m \ + NSEntityDescription+EO.m \ -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/library.make diff --git a/sope-core/EOCoreData/NSEntityDescription+EO.h b/sope-core/EOCoreData/NSEntityDescription+EO.h new file mode 100644 index 00000000..965dcc3e --- /dev/null +++ b/sope-core/EOCoreData/NSEntityDescription+EO.h @@ -0,0 +1,40 @@ +/* + Copyright (C) 2005 SKYRIX Software AG + + This file is part of SOPE. + + SOPE is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + SOPE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with SOPE; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +#ifndef __NSEntityDescription_EO_H__ +#define __NSEntityDescription_EO_H__ + +#import +/* + NSEntityDescription(EO) + + Make an NSEntityDescription behave like an EOEntity. This is mostly to make + the CoreData model objects work with DirectToWeb and EO at the same time. +*/ + +@interface NSEntityDescription(EO) + +- (id)relationshipNamed:(NSString *)_name; +- (id)attributeNamed:(NSString *)_name; + +@end + +#endif /* __NSEntityDescription_EO_H__ */ diff --git a/sope-core/EOCoreData/NSEntityDescription+EO.m b/sope-core/EOCoreData/NSEntityDescription+EO.m new file mode 100644 index 00000000..4151cf02 --- /dev/null +++ b/sope-core/EOCoreData/NSEntityDescription+EO.m @@ -0,0 +1,35 @@ +/* + Copyright (C) 2005 SKYRIX Software AG + + This file is part of SOPE. + + SOPE is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + SOPE is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with SOPE; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +#include "NSEntityDescription+EO.h" +#include "common.h" + +@implementation NSEntityDescription(EO) + +- (id)relationshipNamed:(NSString *)_qname { + return [[self relationshipsByName] objectForKey:_qname]; +} + +- (id)attributeNamed:(NSString *)_qname { + return [[self attributesByName] objectForKey:_qname]; +} + +@end /* NSEntityDescription(EO) */ diff --git a/sope-core/EOCoreData/Version b/sope-core/EOCoreData/Version index d1646130..f3879a62 100644 --- a/sope-core/EOCoreData/Version +++ b/sope-core/EOCoreData/Version @@ -1,3 +1,3 @@ # version file -SUBMINOR_VERSION:=5 +SUBMINOR_VERSION:=6