How to force Initialize a Hibernate JPA proxy to use it in a JSON call
问题 I have a Spring 3 + JPA 2.0 application. In my @Controller I need an initialized object, but I have proxies , I need to be able to initialize it programmatically. I need functionality similar to org.hibernate.Hibernate.initialize(Object) . Can someone help . The object is used for AJAX operations. If the properties are proxies I cannot send it as JSON 回答1: No JPA option to my knowledge. You should use Hibernate.initialize(..) . In fact, when I took a look at the hibernate implementation, lazy