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

 

 

Fetch Specs & Editing Contexts

Fetch Specifications

You usually don't want to fetch everything at once

So you create a quallifier when you create the fetch specification

Defines 3 things about a database query

  1. The database table from which the objects will be retreived - entity
  2. A specification of which objects are desired - qualifier
  3. A specification of the order the objects are to be placed in the array - sort ordering

EOFetchSpecification fetchSpec = new EOFetchSpecification("Entity", Qualifier, SortOrdering);

Three ways to create fetch specification

  1. Explicitly in Java code
  2. With calls to EOUtilities methods
  3. Bind them graphically in EOModeler

Editing Context

Keeps track of business objects used by your application

Fetches data from database and commits changes back to it

Keeps track of changes - allows undo

Every session has a default editing context

EOEditingContext ec = session().defaultEditingContext();