Table of Contents Previous Section
The Movies Application
The Movies application has two pages, each of which allows you to access information from the database in different ways:
- MovieSearch (the main page) lets you search for movies that match user-specified criteria. For example, you can search for all comedies starting with the letter "A". Once you find the movie you're looking for, you can make changes to its data or delete it. You can also use this page to insert new movies into the database.
- MovieDetails displays the actors who star in a selected movie and the roles those actors play. You can add new roles, change the name of a role, and assign a different actor to a role.
Enterprise Objects and the Movies Database
Enterprise Objects Framework manages the interaction between the database and objects in the Movies application. Its primary responsibility is to fetch data from relational databases into enterprise objects. An enterprise object, like any other object, couples data with methods for operating on that data. In addition, an enterprise object has properties that map to stored data. Enterprise object classes typically correspond to database tables. An enterprise object instance corresponds to a single row or record in a database table. Enterprise Objects and Relationships
Relational databases model not just individual entities, but entities' relationships to one another. For example, a movie has zero, one, or more roles. This is modeled in the database by both the MOVIE table and MOVIE_ROLE table having a MOVIE_ID column. In the MOVIE table, MOVIE_ID is a primary key, while in MOVIE_ROLE it's a foreign key.
Table of Contents Next Section