qq_35568224
qq_35568224
2017-08-20 01:54

ssh 表映射后怎么取出映射表中的数据

20
  • 数据
  • ssh
   <many-to-one  name="member"  column="mid" class="abk.model.Member"/>
   <many-to-one  name="school"   column="School" class="abk.model.School" />
   <many-to-one name="province"  column="Province" class="abk.model.Province"/>

    这是我的映射

    sb.append(
            "select c1.classid,c1.classname,s2.id,s2.schoolname,p3.id,p3.provincename from classmanage c1,school s2,province p3");
    sb.append(" where 1=1");
    sb.append(" and c1.school=s2.id");
    sb.append(" and c1.province=p3.id");
    sb.append(" order BY p3.provincename");
    System.out.println(sb.toString());
    List<Classmanage> list = (List<Classmanage>) getHibernateTemplate().find(sb.toString());

            这是我的查询

            classmanage is not mapped [select c1.classid,c1.classname,s2.id,s2.schoolname,p3.id,p3.provincename from classmanage c1,school s2,province p3 where 1=1 and c1.school=s2.id and c1.province=p3.id order BY p3.provincename]

            这是我的异常
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

3条回答