Loading

Quipoin Menu

Learn • Practice • Grow

spring / JPA and Hibernate Introduction
mcq
Direction: Choose the correct option

Q1.

What is JPA?
A. Java Persistence API - a specification for ORM
B. A specific ORM framework
C. A database driver
D. None
Direction: Choose the correct option

Q2.

What is Hibernate?
A. An ORM framework that implements JPA
B. A database
C. A JPA provider
D. Both A and C
Direction: Choose the correct option

Q3.

What is the main advantage of using JPA?
A. Database independence
B. Object-oriented query language (JPQL)
C. Simplifies data access
D. All of the above
Direction: Choose the correct option

Q4.

Which annotation marks a class as an entity?
A. @Entity
B. @Table
C. @Column
D. @Id
Direction: Choose the correct option

Q5.

What does @Id annotation define?
A. The primary key of the entity
B. A unique field
C. A foreign key
D. None
Direction: Choose the correct option

Q6.

What is the purpose of @GeneratedValue?
A. To specify how the primary key is generated (auto, identity, sequence)
B. To generate values automatically
C. To set default value
D. None
Direction: Choose the correct option

Q7.

What does EntityManager do?
A. Manages entities and provides CRUD operations
B. Creates queries
C. Manages transactions
D. All of the above
Direction: Choose the correct option

Q8.

How do you configure JPA in Spring?
A. LocalEntityManagerFactoryBean
B. LocalContainerEntityManagerFactoryBean
C. EntityManagerFactory
D. All
Direction: Choose the correct option

Q9.

What is JPQL?
A. Java Persistence Query Language - object-oriented query language
B. SQL for JPA
C. Native query
D. None
Direction: Choose the correct option

Q10.

What is the difference between JPA and Hibernate?
A. JPA is spec, Hibernate is implementation
B. JPA is older
C. They are same
D. None