Hibernate ORM, JPA Entities Life Cycle, Entity Manager, and Tables

    Question 1DATA JPA - Hibernate ORM Purpose

    What is the main purpose of Hibernate ORM in a Spring Data JPA context?

    Question 2DATA JPA - JPA Entity Annotation

    Which annotation is used to mark a class as a JPA entity in Hibernate ORM?

    Question 3DATA JPA - Code Snippet (Entity Mapping)

    What will the following entity map to in the database?

    @Entity @Table(name = "students") public class Student { @Id private Long id; private String name; }

    Question 4DATA JPA - Entity Life Cycle States

    Which of the following is not a valid JPA entity lifecycle state?

    Question 5DATA JPA - Code Snippet (Entity Manager Persist)

    What happens when the following code executes?

    Student student = new Student(); student.setId(1L); student.setName("Alex"); entityManager.persist(student);

    Question 6DATA JPA - Entity Manager merge() Method

    What does entityManager.merge(entity) do in JPA?

    Question 7DATA JPA - Code Snippet (Remove Entity)

    What will happen when this code executes?

    Student student = entityManager.find(Student.class, 1L); entityManager.remove(student);

    Question 8DATA JPA - @Table Annotation

    What is the role of the @Table annotation in JPA?

    Question 9DATA JPA - Lifecycle Callback Annotations

    Which JPA annotation can be used to execute logic just before an entity is removed?

    Question 10DATA JPA - Persistence Context

    What is the persistence context in JPA?