website 表,字段: websiteid , name ,address ,type(关联type表id),discrible,status,addtime,userid(关联用户表编号)
type表字段: id, nameadvert 表,字段: id,content
advert website中间表 advert_website ,字段: websiteid ,aid 我现在要的效果是select temp.websiteid,temp.name,temp.address,temp.status,temp.addtime,temp.typename,m.count from 
(select w.websiteid,w.name,w.address,w.status,w.addtime,t.name typename 
from website w ,type t  where t.id=w.type and w.userid=1) temp 
left join (select websiteid ,count(*) count from advert_website GROUP BY websiteid)  m 
on temp.websiteid=m.websiteid 怎么写配置,实体been中,要写出对于字段的属性外,还要写什么?麻烦也写出来,小弟今天是第二天用ibatis,呵呵,帮帮忙!

解决方案 »

  1.   

    resultMap的class设置成HashMap就可以了啊?
    以后扩展也方便很多。
      

  2.   

    我顶啊,SQL都写出来的,写个BEAN还不容易,直接你返回啥就写啥了你那应该有参考的例子,直接COYP,把返回值写你的,需要实体类就写个,不要就不写罗
      

  3.   

    http://cxg19830310.blog.163.com/blog/static/45543051200811184395094/看这个吧。
      

  4.   

    我也觉得sql都写出来了。。自己再定义一个Bean还不容易啊。
      

  5.   

    http://cxg19830310.blog.163.com/blog/static/45543051200811184395094/看这个吧。
      

  6.   

    哈哈哈,那天刚看ibatis,让大家笑话了,现在结贴给分。