Storing the Selected Movie
Now, in the MovieDetails component, create a variable that holds the application's selected movie. Later on, you'll add code to the Main.java class that assigns Main's selected movie to this variable.
- Choose Add Variable/Method from the pull-down menu.
- Name the variable selectedMovie.
- Set the variable's type to Movie.
- Check the "An instance variable" box.
- Check the "A method returning the value" box.
- Check the "A method setting the value" box.
- Click Add.
Movie isn't actually a class; it's an entity. It's listed in the combo box as a type along with entries for all the entities in your model. When you choose an entity as the type for your variable, WebObjects Builder recognizes that the variable is an enterprise object. Using information in the model, WebObjects Builder can determine the entity's corresponding enterprise object class and the properties of that class.
Table of Contents Next Section