|
Getting the data from the Database
Four things have to be set up
- An EOModel of the database - done - maps the relational database to
the object model
- A fetch specification - an object that details which objects you want
to fetch from the database
- An editing context - where your EOs live
- graph of objects
- performs the fetch based on the fetch specification
- have to tell it when we change so it can save changes
- slowest operation in an application is save to database
- A variable to hold the array of fetched objects
Steps
- Component creates a fetch specification that describes the object(s)
you want to retrieve
- Give the fetch specification to the editing context
- Editing context uses EOF to communicate with the database and execute
the query
- Database returns raw records
- EOF converts the raw records into objects and then returns them to
the editing context
- Editing context returns the array of objects to the component
Page updated August 25, 2004
|