Home > Articles > Home & Office Computing > Mac OS X

Java Perspective: Advanced Core Data

  • Print
  • + Share This
Although it is possible to use Core Data with little or no coding on your part, what if you want or need more fine-grained control over the persistence layer in your application? In this third article in his Core Data series from a Java perspective, Marcus Zarra walks you through some of the more advanced features of Core Data. Specifically, you'll learn how to retrieve data from a Core Data repository without having to write full SQL queries and how to access the data in Core Data entities.
Like this article? We recommend Java

For more information on Java development, visit our Java Reference Guide or sign up for our Java Newsletter.

Although it is possible to utilize Core Data with little or no coding on the part of the developer, what if you want or need more fine-grained control over the persistence layer in your application? This article walks you through the process of accessing a Core Data persistent store directly in code.

NSManagedObjectModel

The NSManagedObjectModel represents the model that the developer designs using XCode. It contains all the entities for the application, including all the attributes for those entities and the relationships. A Core Data application has at least one model and can contain as many as is necessary. The NSManagedObjectModel is similar in use to a database schema.

The model is not normally accessed directly by the developer other than to pass a pointer/reference to it to other objects such as the NSManagedObjectContext detailed below.

  • + Share This
  • 🔖 Save To Your Account