All,

I'm using  following cache model in the project.

<cacheModel id="my-cache" type="MEMORY" readOnly="true">
      <flushInterval hours="2" />
      <flushOnExecute statement="dummyQuery"/>
  </cacheModel>

<resultMap id="myResultMap" class="myClass" groupBy="Id" >
    <result property="catIdList" resultMap="categoryMap" />
    <result property="mediaList" resultMap="mediaMap" />
    <result column="id" property="Id" jdbcType="INTEGER" />
    ...
</resultMap>

<select id="Result" resultMap="myResultMap" cacheModel="my-cache" >
...
</select>

myResultMap is a large object with two lists (list of objects) using groupBy feature. My query joins (includes left join) several tables. Query result is a list of myResultMap object. Here are a couple of issues.

1) if all fields of an object on the list (catIdList or medialList) are null (from left join), the object should not be on the list. But groupBy doesn't exclude this kind of object. Also, groupBy doesn't remove duplicate object on the list (
catIdList or medialList).
2) it takes pretty long time (150-200 ms) to retrieve a large object from the cache. I timed before and after "return queryForList("Result", null)".

BTW, i'm using daoManager and code generated by Abator.

I might do something wrong. Any suggestions will be appreciated.

Thanks,
Tony

Reply via email to