nerdexam
Oracle

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()…

Entity Relationships

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)
  • A
    81% (22)
  • B
    11% (3)
  • C
    4% (1)
  • D
    4% (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

#OneToMany#unidirectional relationship#foreign key mapping#entity mapping

Community Discussion

No community discussion yet for this question.

Full 1Z0-898 Practice