Subjects

All subjects Django Java Python React Spring Boot JavaScript PHP
Sign Up Free
Spring Boot 10 questions

Spring Data JPA & Database Integration

Integrate Hibernate and JPA. Master repository interfaces, query methods, transactional boundaries, entity mappings, and lazy loading.

More Spring Boot
Interview questions 1–10 of 10
1

What is Spring Data JPA and how does it simplify database access?

Spring Data JPA is an abstraction layer built on top of JPA (Java Persistence API) and Hibernate that eliminat...

Read answer →
2

What is the difference between CrudRepository, JpaRepository, and PagingAndSortingRepository?

CrudRepository is the base interface providing basic CRUD operations: save(), findById(), findAll(), delete(),...

Read answer →
3

How do derived query methods work in Spring Data JPA?

Derived query methods let Spring Data generate a query automatically by parsing the method name. Keywords like...

Read answer →
4

What is the difference between @Query with JPQL and native SQL queries?

@Query lets you write a custom query directly on a repository method when a derived method name would be too c...

Read answer →
5

What are the JPA entity relationship annotations (@OneToMany, @ManyToOne, @ManyToMany)?

JPA relationship annotations map object references between entities to foreign keys or join tables. @OneToOne...

Read answer →
6

What is the difference between FetchType.LAZY and FetchType.EAGER?

FetchType.LAZY defers loading a related entity or collection until it is actually accessed in code, returning...

Read answer →
7

How does @Transactional work in Spring Boot?

@Transactional demarcates a method or class as running inside a database transaction. Spring wraps the annotat...

Read answer →
8

What is the N+1 query problem and how do you solve it in Spring Data JPA?

The N+1 problem occurs when fetching a list of N parent entities triggers 1 query for the parents plus N addit...

Read answer →
9

How do you configure database connection pooling in Spring Boot (HikariCP)?

Spring Boot uses HikariCP as the default connection pool when spring-boot-starter-data-jpa or spring-boot-star...

Read answer →
10

How does Spring Boot manage database schema migrations (Flyway vs Hibernate ddl-auto)?

spring.jpa.hibernate.ddl-auto lets Hibernate generate or update the schema automatically based on entity class...

Read answer →