0

Will Hibernate automatically write the state of an object into a byte-stream i.e. serialization and save it to database?

I want to know how Hibernate saves a entity to database. Please correct me if I have anything wrong.

HoangBinh
  • 27
  • 2
  • a google search for "how does hibernate work" has lots of great answers. – jtahlborn Jan 16 '21 at 15:17
  • @jtahlborn: They only indicate that it works externally but I want to know how it works internally. Can you let me know if you know how it works? – HoangBinh Jan 16 '21 at 15:21
  • then you will need to be more specific about what details you are looking for – jtahlborn Jan 16 '21 at 15:24
  • @jtahlborn: I am reading Serialization and the document said "Serialization in Java is a mechanism of writing the state of an object into a byte-stream. It is mainly used in Hibernate, RMI, JPA, EJB and JMS technologies." so I want to know how it is mainly used in Hibernate and JPA. – HoangBinh Jan 16 '21 at 15:29
  • it isn't. not sure what you are reading. – jtahlborn Jan 16 '21 at 15:29
  • https://stackoverflow.com/questions/2726300/do-hibernate-table-classes-need-to-be-serializable – jtahlborn Jan 16 '21 at 15:32

1 Answers1

0

Hibernate use jdbc and sql. As user of hibernate i suggested to understand SQL (especially subjects: select,join`s, index, query planning (how to see and interpret query plan)(last is more advanced))

You can see actual sql for some profile when develop your application using for example https://p6spy.readthedocs.io/en/latest/configandusage.html