Main Menu
Lecture 1
Lecture 2
Lecture 4
Lecture 5
Lecture 6
Lecture 7
 

 

 

Getting the data from the Database

Four things have to be set up

  1. An EOModel of the database - done - maps the relational database to the object model
  2. A fetch specification - an object that details which objects you want to fetch from the database
  3. An editing context - where your EOs live
    1. graph of objects
    2. performs the fetch based on the fetch specification
    3. have to tell it when we change so it can save changes
    4. slowest operation in an application is save to database
  4. A variable to hold the array of fetched objects

Steps

  1. Component creates a fetch specification that describes the object(s) you want to retrieve
  2. Give the fetch specification to the editing context
  3. Editing context uses EOF to communicate with the database and execute the query
  4. Database returns raw records
  5. EOF converts the raw records into objects and then returns them to the editing context
  6. Editing context returns the array of objects to the component