Java Reference
In-Depth Information
Let's say we would want to add an address for our customer. We could do so by
clicking on the
Index
link, then clicking on
Show All Address Items
, then on
New Address
.
The
Address
entity is at the "one" end of several one-to-many relationships, notice
how a combo box is generated for each one of the entities at the "many" end. Since
we wish to assign this address to the customer we just added, we attempt to select a
customer from the
CustomerId
combo box.
A better name could be used for the
CustomerId
field. The reason this is
the label for the combo box is because it matches the property name on
the
Address
JPA entity, which in turn could have a better name, such
as
customer
. Recall that all entities on this project were automatically
generated from an existing database schema.