CST 8277 final Exam Questions and Correct Answers 100% Verified Graded A+
Question 1:
Given the code segment below, ??? should be replaced with what?
@Entity(name = "Student")
@Table(name = "student_table")
@NamedQuery(name = "Student_findAll", query = "SELECT s FROM ??? s")
public class StudentPoJo extends PoJoBase implements Serializable { ... }
A. student_table
B. Student
C. StudentPoJo
D. PoJoBase - B. Student
explain: The query is a JPQL (Java Persistence Query Language) query, and in JPQL, the FROM
clause should refer to the entity name defined by the @Entity annotation
Question 2:When writing JPA criteria queries, you may need to use what in order to complete the
queries?
A. JUnit test classes, for example, EmployeeTest, StudentTest
B. Classes that extend com.alongwith.privileges.cst8277.models.PoJoBase
, C. JPA metamodel classes, for example, studentPOJO_, professorPOJO_, coursePOJO_
D. EJB session beans, for example, studentEJB, professorEJB, courseEJB - C. JPA
metamodel classes, for example, studentPOJO_, professorPOJO_, coursePOJO_
explain: JPA criteria queries often use metamodel classes: POJOs
Question 3:If there is a field or property in your entity class database, you should annotate that
field or property with what if you do NOT want to map to a table column in your database?
A. @Basic
B. @Transient
C. @JsonIgnore
D. @DoNotMap - B. @Transient
explain: The @Transient annotation in JPA is used to mark a field or property so that it is not
persisted to the database (i.e., it won't map to a table column).
Question 4:What does the annotation below mean?
public class PoJoBase { @JsonInclude(JsonInclude.Include.NON_NULL) ...
}
A. Null values will not appear in the JSON representation of an instance of PoJoBase.
B. Only null values appear in the JSON representation of an instance of PoJoBase.
Question 1:
Given the code segment below, ??? should be replaced with what?
@Entity(name = "Student")
@Table(name = "student_table")
@NamedQuery(name = "Student_findAll", query = "SELECT s FROM ??? s")
public class StudentPoJo extends PoJoBase implements Serializable { ... }
A. student_table
B. Student
C. StudentPoJo
D. PoJoBase - B. Student
explain: The query is a JPQL (Java Persistence Query Language) query, and in JPQL, the FROM
clause should refer to the entity name defined by the @Entity annotation
Question 2:When writing JPA criteria queries, you may need to use what in order to complete the
queries?
A. JUnit test classes, for example, EmployeeTest, StudentTest
B. Classes that extend com.alongwith.privileges.cst8277.models.PoJoBase
, C. JPA metamodel classes, for example, studentPOJO_, professorPOJO_, coursePOJO_
D. EJB session beans, for example, studentEJB, professorEJB, courseEJB - C. JPA
metamodel classes, for example, studentPOJO_, professorPOJO_, coursePOJO_
explain: JPA criteria queries often use metamodel classes: POJOs
Question 3:If there is a field or property in your entity class database, you should annotate that
field or property with what if you do NOT want to map to a table column in your database?
A. @Basic
B. @Transient
C. @JsonIgnore
D. @DoNotMap - B. @Transient
explain: The @Transient annotation in JPA is used to mark a field or property so that it is not
persisted to the database (i.e., it won't map to a table column).
Question 4:What does the annotation below mean?
public class PoJoBase { @JsonInclude(JsonInclude.Include.NON_NULL) ...
}
A. Null values will not appear in the JSON representation of an instance of PoJoBase.
B. Only null values appear in the JSON representation of an instance of PoJoBase.