In the book example, the @JoinColumn annotation references the CUSTOMER_ID column
in the PHONE table not in the CUSTOMER table. This example is using what the books calls
reverse pointers.
However, if we take a look at the JPA specs, we'll find the following in section 9.1.24 (OneToMany Annotation):
The default schema-level mapping for unidirectional one-to-many relationships uses a join table, as described in Section 2.1.8.5. Unidirectional one-to-many relationships may be implemented using one-to-many foreign key mappings, however, such support is not required in this release. Applications that want to use a foreign key mapping strategy for one-to-many relationships should make these relationships bidirectional to ensure portability.
There's an example in the book and it seems to be working fine. I guess this is an Hibernate extension.
Nevertheless, as far as the exam goes this is not mandatory and the recommended design would be to use one-to-many bidirectional relationships (exactly like in nitin's code snippet).
[ June 24, 2008: Message edited by: Sergio Tridente ]