What does Hibernate.initialize do?

前端 未结 4 1105
遇见更好的自我
遇见更好的自我 2021-01-04 06:19

What does Hibernate.initialize do?
Usually referred documentation talk only about

Hibernate.initialize(entity.lazyCollection)

Is ther

4条回答
  •  感动是毒
    2021-01-04 07:06

    I agree with Alan Hay, here is my experience, I've had this problem when running the JUNit tests, some of the lazy objects were not loading when trying to load the objects in another session. I had to call the Hibernate.initialize(Object) to load the lazy objects into the memory.

提交回复
热议问题