O'Reilly logo

Core Java® Volume II—Advanced Features, Ninth Edition by Gary Cornell, Cay S. Horstmann

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

8.9.2. A Complete Example for JavaBeans Persistence

We’ll end the description of JavaBeans persistence with a complete example (see Figure 8.15). This application writes a damage report for a rental car. The rental car agent enters the rental record, selects the car type, uses the mouse to click on damaged areas on the car, and saves the report. The application can also load existing damage reports. Listing 8.10 contains the code for the program.

Image

Figure 8.15. The DamageReporter application

The application uses JavaBeans persistence to save and load DamageReport objects (see Listing 8.11). It illustrates the following aspects of the persistence ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required