Chapter 4. Implementing Unidirectional Functional Associations with Java EE

Table of Contents
1. Implementing Single-Valued Reference Properties in Java
2. Make a Java Entity Class Model
3. New Issues
4. Write the Model Code
4.1. Summary
4.2. Code each class of the Entity class model
4.3. Code the constraints
4.4. Code getters and setters
4.5. Implement a deletion policy
4.6. Serialization and De-Serialization
5. The View and Controller Layers
5.1. Initialize the app
5.2. Show information about associated objects in Retrieve/List All
5.3. Allow selecting associated objects in Create and Update
5.3.1. Create the Object-to-String converter
5.3.2. Write the view code

A unidirectional functional association is either one-to-one or many-to-one. In both cases such an association is represented, or implemented, with the help of a single-valued reference property.

In this chapter, we show

  1. how to derive a data model in the form of a Java Entity class model from an OO class model with single-valued reference properties representing unidirectional functional associations,

  2. how to code the Java Entity class model in the form of entity classes (implementing model classes),

  3. how to write the view and controller code based on the entity classes.