Spring Data JPA Basics
Spring Data JPA, JpaRepository, EntityManager, DataSource, HikariCP, JPA configuration (spring.jpa.*)
1What is JPA (Java Persistence API)?
What is JPA (Java Persistence API)?
Antwort
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.
2What is the main advantage of using JPA over pure JDBC?
What is the main advantage of using JPA over pure JDBC?
Antwort
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.
3What is the main role of the EntityManager in JPA?
What is the main role of the EntityManager in JPA?
Antwort
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.
What is the difference between JPA and Hibernate?
What is the persistence context in JPA?
+22 Interview-Fragen
Weitere Spring Boot-Interviewthemen
Spring Core - IoC & DI
Spring Boot Auto-Configuration
Spring Boot Starters
Application Properties & YAML
Logging with SLF4J & Logback
Spring Boot DevTools
Spring MVC Basics
Spring REST Controllers
Request & Response Handling
Exception Handling
Bean Validation
JPA Entities & Relationships
JPA Queries
Spring Data Repositories
Spring Security Basics
Spring Boot Actuator
Unit Testing with JUnit & Mockito
Spring Boot Testing
Profiles & Environment
RestTemplate & WebClient
Async & Scheduling
Caching with Spring
Spring WebFlux (Reactive)
Spring Transactions
Advanced Authentication & Authorization
JWT & Stateless Security
OAuth2 & Authorization Server
Spring Boot & Docker
Microservices with Spring
Spring Cloud Config
Performance Optimization
GraalVM Native Images
Meistere Spring Boot für dein nächstes Interview
Zugang zu allen Fragen, Flashcards, technischen Tests, Code-Review-Übungen und Interview-Simulatoren.
Kostenlos starten