GNUstep Core Data  0.1
GSPersistentStore.h
00001 /* Interface of the GSPersistentStore class for the GNUstep
00002    Core Data framework.
00003    Copyright (C) 2005 Free Software Foundation, Inc.
00004 
00005    Written by:  Saso Kiselkov <diablos@manga.sk>
00006    Date: August 2005
00007 
00008    This file is part of the GNUstep Core Data framework.
00009 
00010    This library is free software; you can redistribute it and/or
00011    modify it under the terms of the GNU Lesser General Public
00012    License as published by the Free Software Foundation; either
00013    version 2.1 of the License, or (at your option) any later version.
00014 
00015    This library is distributed in the hope that it will be useful,
00016    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018    Lesser General Public License for more details.
00019 
00020    You should have received a copy of the GNU Lesser General Public
00021    License along with this library; if not, write to the Free
00022    Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
00023  */
00024 
00025 #ifndef _GSPersistentStore_h_
00026 #define _GSPersistentStore_h_
00027 
00028 #include <Foundation/NSObject.h>
00029 
00030 @class NSString,
00031        NSDictionary,
00032        NSMutableDictionary,
00033        NSArray,
00034        NSError,
00035        NSSet,
00036        NSPredicate;
00037 @class NSURL,
00038        NSEntityDescription,
00039        NSManagedObjectModel,
00040        NSManagedObjectID,
00041        NSFetchRequest;
00042 
00043 @interface GSPersistentStore : NSObject
00044 {
00045   NSURL * _URL;
00046   NSManagedObjectModel * _model;
00047   NSString * _configuration;
00048 
00049   NSDictionary * _metadata;
00050 
00051   NSMutableDictionary * _versionNumbers;
00052 }
00053 
00054 -       initWithURL: (NSURL *) URL
00055  managedObjectModel: (NSManagedObjectModel *) model
00056       configuration: (NSString *) configuration
00057             options: (NSDictionary *) options;
00058 
00059 - (NSURL *) URL;
00060 - (NSString *) configuration;
00061 - (void) setUUID: (NSString *) newUUID;
00062 
00063 // store metadata manipulation
00064 - (void) setMetadata: (NSDictionary *) metadata;
00065 - (NSDictionary *) metadata;
00066 
00067 - (BOOL) saveObjects: (NSSet *) objects
00068                error: (NSError **) error;
00069 
00070 - (unsigned long long) versionNumberForObjectID:(NSManagedObjectID *)objectID;
00071 
00072 // subclasses must override these methods
00073 
00074 - (NSString *) storeType;
00075 - (unsigned long long) highestIDValue;
00076 - (NSDictionary *) fetchObjectsWithEntity: (NSEntityDescription *) entity
00077                                 predicate: (NSPredicate *) predicate
00078                                     error: (NSError **) error;
00079 - (NSDictionary *) fetchObjectWithID: (NSManagedObjectID *) objectID
00080                      fetchProperties: (NSSet *) propertiesToFetch;
00081 - (NSDictionary *) fetchObjectsWithEntity: (NSEntityDescription *) entity
00082                                 predicate: (NSPredicate *) predicate
00083                                     error: (NSError **) error;
00084 - (BOOL) writeSavingObjects: (NSSet *) objectsToWrite
00085                         deletingObjects: (NSSet *) objectIDsToDelete
00086                       error: (NSError **) error;
00087 @end
00088 
00089 #endif // _GSPersistentStore_h_