1.D:\0kecheng\bos\bosv2.0_chapter03.无条件查询.
@JSON(serialize=false)是注解排除不需要加载的属性,找到它的get方法,解决no-session问题.
只要在web.xml配置:不需要配置上面的@JSON了.
在hibernate使用
<filter>
<filter-name>OpenSession</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>OpenSession</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
在Spring data jpa使用
<filter>
<filter-name>OpenEntity</filter-name>
<filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>OpenEntity</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>