<sqlMap namespace="Nav">
<resultMap class="com.ht.domain.Nav" id="NavResult">
<result property="id" column="id"/>
<result property="parentid" column="parentid"/>
<result property="name" column="name"/>
<result property="ord" column="ord"/>
<result property="url" column="url"/>
<result property="templet" column="templet"/>
<result property="dis" column="dis"/>
<result property="navs" column="id" select="Nav.getChildren" />
</resultMap>
<select id="getChildren" resultClass="com.ht.domain.Nav" >
select
id,parentid,name,ord,url,templet,dis
from ht_nav
where parentid = #parentid# order by ord asc
</select>
</sqlMap>
在实体bean里面放入自己的list,column对应自己查询条件的列,
如果是关联其他表,无非column对应就是关联的外键,查询的语句是查其他表,注意下resultClass想对的实体就ok