hibernate二级缓存使用

来源:互联网 发布:长篇网络禁书百度云 编辑:程序博客网 时间:2024/04/30 15:48
  • 在hibernate_cfg.xml文件中增加配置



org.hibernate.cache.EhCacheProvider



true

  • 在map文件Instrument.hbm.xml文件增加


name="InstrumentB"
table="instrument_b"
>
false


name="StationNo"
column="StationNo"
type="integer"
/>
name="InstruTypeNo"
column="InstruTypeNo"
type="integer"
/>



注意:false之后;

  • ehcache.xml






经测试,没有此文件也能正常工作,不知应该放在哪个目录下


原创粉丝点击