Creating a WebObjects Database Application
One of the most powerful features of WebObjects is its ability to provide access to databases. To do so, it uses a framework called the Enterprise Objects Framework. This chapter introduces you to the Enterprise Objects Framework by showing you how to create a simple database application. The steps you take in creating this application demonstrate the principles you'll use in every other application you develop with the WebObjects and Enterprise Objects Framework.
- Use the WebObjects Application Wizard to create a fully functional Main component that reads and writes from the Movies database.
- Create and configure display groups for interacting with a database in terms of objects.
- Create bindings between display groups and a user interface.
- Write code to manipulate display groups' selected objects.
- Set up display groups in a master-detail configuration.
- Use EOModeler to maintain a model file.
- Create custom enterprise object classes.
- Enterprise Objects and the Movies Database
- Enterprise Objects and Relationships
- Starting the WebObjects Application Wizard
- Specifying a Model File
- Choosing an Adaptor
- Choosing What to Include in Your Model
- Choosing the Tables to Include
- Specifying Primary Keys
- Specifying Referential Integrity Rules
- Choosing an Entity
- Choosing a Layout
- Choosing Attributes to Display
- Choosing an Attribute to Display as a Hyperlink
- Choosing Attributes to Query On
- Running Movies
- Examining the Variables
- Examining the Bindings
- Bindings in the Query Part
- Bindings in the Repetition Part
- Bindings in the Editing Part
- Specifying a Sort Order
- Specifying Default Values for New Enterprise Objects
- Setting a Date Format
- Setting a Number Format
- Optional Exercise
- Creating the MovieDetails Component
- Storing the Selected Movie
- Navigating from Main to MovieDetails
- Designing MovieDetails' User Interface
- Adding Date and Number Formats
- Navigating from MovieDetails to Main
- Running Movies
- Opening Your Model
- Removing Primary and Foreign Keys as Class Properties
- Adding Relationships to Your Model
- Using the Advanced Relationship Inspector
- Where Do Primary Keys Come From?
- Setting Up a Master-Detail Configuration
- Creating a Detail Display Group
- Adding a Repetition
- Configuring a Repetition
- Running Movies
- Updating Objects in the Detail Display Group
- Managing a DisplayGroup's Selection
- Adding a Form
- Adding a Talent Display Group
- Configuring the Browser
- Adding Insert, Save, and Delete Buttons
- Adding Behavior to Your Enterprise Objects
- Specifying Custom Enterprise Object Classes
- Generating Custom Enterprise Object Classes
- Adding Custom Behavior to Talent
- Providing Default Values in MovieRole
- Running Movies