How to convert a Hibernate proxy to a real entity object

后端 未结 10 787
离开以前
离开以前 2020-11-22 16:49

During a Hibernate Session, I am loading some objects and some of them are loaded as proxies due to lazy loading. It\'s all OK and I don\'t want to turn lazy lo

10条回答
  •  遥遥无期
    2020-11-22 17:47

    The another workaround is to call

    Hibernate.initialize(extractedObject.getSubojbectToUnproxy());
    

    Just before closing the session.

提交回复
热议问题