1

Hibernate has the concept of entity state (transient, persistent, and detached). Is there a similar concept is in Spring Data JPA also?
I have gone through official Spring Data Jpa doc. This document talks about the checking of entity states but there is no discussion about how many entity state Spring Data JPA supports.

My question is: Does Spring Data JPA support multiple entity states? If yes, how many entity states are there?

Jens Schauder
  • 77,657
  • 34
  • 181
  • 348
Nishant Bhardwaz
  • 924
  • 8
  • 21

1 Answers1

0

Spring Data JPA does not implement the persistence itself. Instead it relies on JPA and it's implementations. Hibernate is the most popular implementation.

The concept of entity lifecycle is integral part of JPA. Therefore for all intents and purposes Spring Data JPA has the exact same entity states as Hibernate/JPA, although technically Spring Data JPA has no such state because that is completely handled by the JPA implementation.

For more information about the relation between Spring Data JPA and JPA see What's the difference between JPA and Spring Data JPA? and Spring + hibernate versus Spring Data JPA: Are they different?

Jens Schauder
  • 77,657
  • 34
  • 181
  • 348