Hibernate & Spring Data JPA interview questions

Upasana | July 24, 2020 | 2 min read | 588 views


Compilation of important Hibernate and Spring Data JPA interview questions for java developers.
  • Hibernate vs Spring Data JPA? What is difference

  • What are inheritance mapping strategies in JPA

  • What are different states of an entity in persistence context?

  • What are dirty read, non-repeatable read and phantom read?

  • What are different Transaction Propagation Levels?

  • What are different types of entity relationships in RDBMS?

  • What is difference between JPA unidirectional OneToOne and ManyToOne?

  • How to prevent lost updates in database transactions using spring data jpa

  • What is N+1 problem in Hibernate, how will you identify and solve it

  • How will you implement database table backed job queue using Spring Hibernate?

  • How to implement thread safe table backed global counter in spring hibernate?

  • Difference between getOne and findById in Spring Data JPA?

  • How to configure multiple data sources in Spring Data JPA?

  • How to implement optimistic locking in database using hibernate?

  • Is EntityManagerFactory and EntityManager thread-safe?

  • How to send an email from a transactional service only if the transaction succeeds?

  • How to fetch stream of records from a very big database table?

  • Batch insert data into database table using Spring Data JPA?

  • How to write testcase for Hibernate/Spring Data JPA?

  • How to use Projections to limit the record columns returned by Spring Data JPA query?

  • How to prevent Jackson from serializing the lazy relationship objects?

  • When do you annotate your repository with NoRepositoryBean?

  • How to persist million records into database using Spring Data JPA in an efficient manner?

  • How to execute Repository queries asynchronously?

  • How to upgrade your database from one application version to another?

  • Pros and cons of different ID generation Strategies in Hibernate?

  • Reactive database operations using Postgres and Spring Boot 2

  • Reactive mongodb operations using Spring Boot 2

  • How to use Projections to fetch the limited content from database?

  • How will you implement OneToOne relation using Spring Data JPA

  • How to use Criteria Builder API in Spring Data JPA


Top articles in this category:
  1. Top 50 Spring Interview Questions
  2. Cracking core java interviews - question bank
  3. Multi-threading Java Interview Questions for Investment Bank
  4. Sapient Global Market Java Interview Questions and Coding Exercise
  5. ION Trading Java Interview Questions
  6. Morgan Stanley Java Interview Questions
  7. Goldman Sachs Java Interview Questions

Recommended books for interview preparation:

Find more on this topic: