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>…
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)- A79% (22)
- B11% (3)
- C7% (2)
- D4% (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
Community Discussion
No community discussion yet for this question.