0 0

Hibernate 使用 ehcache 缓存时,many-to-one 中的one为空0

在使用Hibernate4,ehcache 2.6时,对实体类进行缓存,
实体类配置如下:
   <class name="com.test.model.Info" table="info">
<cache usage="read-write"/>

many-to-one 配置:

<many-to-one name="type" class="com.test.model.Type"
column="type_id" lazy="false" insert="false" update="false" not-found="ignore"/>

ehcache.xml配置如下:
<cache name="com.test.model.Info" maxEntriesLocalHeap="100"
eternal="false" timeToIdleSeconds="300" timeToLiveSeconds="600" overflowToDisk="false" />


在列表页读取One中的数据,对新添加的Info,第二次刷新列表,One的属性为Null。

是哪里不对吗?
2013年9月17日 08:20
目前还没有答案

相关推荐

Global site tag (gtag.js) - Google Analytics