nerdexam
Oracle

1Z0-898 · Question #4

The Contact Information embeddable class contains address information as well as a reference to a phone entity. The ContactInformation class is defined as follows: @Embeddable public class…

The correct answer is A. @Entity public class Employee {. See the full explanation below for the reasoning.

Question

The Contact Information embeddable class contains address information as well as a reference to a phone entity. The ContactInformation class is defined as follows:

@Embeddable public class ContactInformation { String street; String city; @OneToOne Phone phone; } The developer wants to use this class in an Employee entity, but override the default name of the foreign key to the Phone entity. Which of the code segments shows how to do this correctly?

Options

  • A@Entity public class Employee {
  • B@AssociationOverride (name = "empInfo.phone", joinColumn = "INFO_FK")
  • C@ AssociationOverride (name = "empInfo.phone", joinColumn = "INFO_FK")
  • DEntity public class Employee {

How the community answered

(39 responses)
  • A
    74% (29)
  • B
    13% (5)
  • C
    5% (2)
  • D
    8% (3)

Community Discussion

No community discussion yet for this question.

Full 1Z0-898 Practice