1Z0-898 · Question #48
The developer wants to define a unidirectional relationship from the customer entity to the order entity and map this relationship using a foreign key mapping strategy. Which one of the pairs of…
The correct answer is A. @Entity public class Customer {. JoinColumnspecifies a column for joining an entity association or element collection. Example: unidirectional one-to-many association using a foreign key mapping // In Customer class @JoinColumn(name="CUST_ID") // join column is in table for Order public Set<Order> getOrders()…
Question
The developer wants to define a unidirectional relationship from the customer entity to the order entity and map this relationship using a foreign key mapping strategy. Which one of the pairs of classes below correctly achieves this task?
Options
- A@Entity public class Customer {
- B@Entity public class Customer {
- C@Entity public class Customer {
- D@ Entity public class Customer {
How the community answered
(27 responses)- A81% (22)
- B11% (3)
- C4% (1)
- D4% (1)
Explanation
JoinColumnspecifies a column for joining an entity association or element collection. Example: unidirectional one-to-many association using a foreign key mapping // In Customer class @JoinColumn(name="CUST_ID") // join column is in table for Order public Set<Order> getOrders() {return orders;}
Topics
Community Discussion
No community discussion yet for this question.