user285110
user285110

Reputation:

Bulding a new "Core Data" AtomicStore, the missing pieces

I am in the process to implement an AtomicStore subclass to save data in a MySQL DB. The system already works pretty well besides the implementation of fetch-requests. The fetches should include the cached nodes but also fire a "select" on the underlaying SQL db.

I have currently only worked on SubClasses for NSAtomicStore and NSAtomicStoreCacheNode. So running a fetch will only result to search within any cached nodes. As fetched is effectively done on an NSManagedObjectContext instance I would assume that also this class needs an overwrite.

Anyway in my current understanding of Core Data I assumed that anything specific for a "custom store" will be done only in NSAtomicStore (and NSAtomicStoreCacheNode). So I looked for something here will should execute a fetch.

As the SQLite implementation is not avail. in source code I digged a bit into "GnuStep", here a "fetch-method" is injected into the NSAtomicStore. Maybe somebody can point me to the right direction here.

Thus maybe there are some "hidden" interfaces on NSAtomicStore to be overridden or the need to subclass NSManagedObjectContext.

Upvotes: 2

Views: 742

Answers (1)

rickster
rickster

Reputation: 126157

This question couldn't really be solved when it was written in 2010, but the "missing link" for solving this problem was provided in Mac OS X 10.7 and iOS 5 in the form of the NSIncrementalStore abstract class. NSIncrementalStore subclasses can be implemented that hook up to MySQL, other RDBMS, "NoSQL" databases, or even web services.

Upvotes: 3

Related Questions