nerdexam
Oracle

1Z0-898 · Question #28

The developer has modeled student interests as a set <String>: @Entity public class Student { @Id int student Id; string name; @ElementaryCollection Set <String> Interests; . . . } The developer…

The correct answer is A. @ElementaryCollection. Example of a ElementCollection relationship to a basic value annotations[edit] @Entity public class Employee { @Column(name="EMP_ID") private long id; @ElementCollection @CollectionTable( joinColumns=@JoinColumn(name="OWNER_ID") @Column(name="PHONE_NUMBER") private List<String>…

Entity Relationships

Question

The developer has modeled student interests as a set <String>:

@Entity public class Student { @Id int student Id; string name; @ElementaryCollection Set <String> Interests; . . . } The developer wants the values of this set to be stored using a column named student_intersets. Select the item below that accomplishes this task:

Options

  • A@ElementaryCollection
  • B@ElementaryCollection (column = "student_intersets") Set<String>
  • C@ElementaryCollection @CollectionTable (column = "student_intersets")
  • D@ElementaryCollection @CollectionTable (column = @column(name =

How the community answered

(28 responses)
  • A
    79% (22)
  • B
    11% (3)
  • C
    7% (2)
  • D
    4% (1)

Explanation

Example of a ElementCollection relationship to a basic value annotations[edit] @Entity public class Employee { @Column(name="EMP_ID") private long id; @ElementCollection @CollectionTable( joinColumns=@JoinColumn(name="OWNER_ID") @Column(name="PHONE_NUMBER") private List<String> phones;

Topics

#ElementCollection#CollectionTable#column mapping#basic type collection

Community Discussion

No community discussion yet for this question.

Full 1Z0-898 Practice