hibernate二級緩存是由SessionFactory管理
hibernate二級緩存的使用需要進行必要的配置
true
org
hibernate二級緩存配置上之後
Student
public class Student {
private Integer id;
private String name;
//一系列的setter
}
Student
<class name=
<!
<!
<cache usage=
<id name=
<generator class=
</id>
<property name=
</class>
ehcache
<ehcache>
<!
<diskStore path=
<!
maxElementsInMemory=
eternal=
timeToIdleSeconds=
timeToLiveSeconds=
overflowToDisk=
<defaultCache
maxElementsInMemory=
eternal=
timeToIdleSeconds=
timeToLiveSeconds=
overflowToDisk=
/>
</ehcache>
hibernate
<hibernate
<session
<property name=
<property name=
<property name=
<property name=
<property name=
<property name=
<!
<property name=
<!
<property name=
<mapping resource=
<!
<class
</session
</hibernate
From:http://tw.wingwit.com/Article/program/Java/ky/201311/28276.html