解决方案 »

  1.   

    你先看看 这个sql执行的结果是多少
    select s.*,p.* from survey s,page p where s.id=p.s_id and s.id=1 
      

  2.   

    然后再看看这俩有区别么 select s.*,p.* from page p left join survey s where s.id=p.s_id and s.id=1
      

  3.   


    <resultMap id="surveyMap" class="Survey">
    Survey本身的属性...
    <result column="id" property="pagelist" select="Survey.getPagelist" />
    </resultMap>

    <select id="getSurvey" resultMap="surveyMap">
    <![CDATA[
    select * from teacher Survey where XXXX;
    ]]> 
    </select>

    <select id="getPagelist" resultClass="Page">
    <![CDATA[
    select * from Page where XXXXX
    ]]> 
    </select>
      

  4.   

    请问你是怎么解决的,是否是这里缺少
    <collection property="pagelist" ofType="Page">
    <id column="id" property="p_id"/>
    <result column="p_title" property="p_title"/>
    <result column="p_desc" property="p_desc"/>
    </collection>