The developer is creating a Java Persistence model for a legacy database. The database contains customer and subscriptions.
The subscriptions table has a foreign key to the Customer table, a foreign key to the magazines table, and a column that stores a java.util.Date (the subscription expiration date).
The developer wants to create entities Customer and subscription to model these tables and to represent the relationship between customer and subscription as a java.util.Map.
Which one of the following fields of the Customer entity accomplishes this task?
Correct Answer: E
Explanation/Reference:
* The ElementCollection values are always stored in a separate table. The table is defined through the
@ CollectionTable annotation or the <collection-table> element.
* Annotation Type Temporal
This annotation must be specified for persistent fields or properties of type java.util.Date and java.util.Calendar.
Reference: javax.persistence, Annotation Type Temporal