Spring Boot

Spring Data JPA Basics

Spring Data JPA, JpaRepository, EntityManager, DataSource, HikariCP, JPA configuration (spring.jpa.*)

25 면접 질문·
Mid-Level
1

What is JPA (Java Persistence API)?

답변

JPA is a standard Java specification that defines common interfaces for relational object persistence. It allows mapping Java classes to relational database tables. Hibernate, EclipseLink and OpenJPA are implementations of this specification. Using JPA allows changing ORM implementation without rewriting business code.

2

What is the main advantage of using JPA over pure JDBC?

답변

JPA allows manipulating Java objects rather than writing SQL manually. The ORM automatically handles mapping between classes and tables, generates SQL queries, and manages entity relationships. This reduces boilerplate code, decreases manual mapping errors, and improves business code maintainability.

3

What is the main role of the EntityManager in JPA?

답변

The EntityManager is the central JPA interface that manages entity lifecycle and their interaction with the database. It provides methods to persist, find, update and delete entities. The EntityManager also manages the persistence context which maintains the first-level cache of loaded entities.

4

What is the difference between JPA and Hibernate?

5

What is the persistence context in JPA?

+22 면접 질문

다음 면접을 위해 Spring Boot을 마스터하세요

모든 질문, flashcards, 기술 테스트, 코드 리뷰 연습, 면접 시뮬레이터에 접근하세요.

무료로 시작하기