Does hibernate internally uses Serialization for persisting POJO classes? If yes, How does it use it in persisting data? If No, then how does it persist data to DB?
Asked
Active
Viewed 250 times
0

kumarmo2
- 1,381
- 1
- 20
- 35
1 Answers
-1
Hibernate persists data to the database using SQL. Java serialization is not used at all. (SQL) databases are language-agnostic. As such, they cannot depend on language-specific technology such as Java serialization.
Serialization is only relevant when you need to send a POJO over the wire to other servers running Java. For example, if you have some sort of cache of POJOs that spans multiple machines, you could use serialization to send copies of the POJO over the wire.
See https://stackoverflow.com/a/2726387/14731 for a related discussion.

Gili
- 86,244
- 97
- 390
- 689