(四)遇到的问题-1

来源:互联网 发布:去哪里学软件编程 编辑:程序博客网 时间:2024/05/18 01:55

1.      无法读取数据库中表:

org.hibernate.hql.ast.QuerySyntaxException: VOSTUis not mapped [ from VOSTU where xsxh = ?]

该报错源自service类中的sql查询语句。改正方法是不再使用数据库中的表名,而是应该使用此处定义的VO类名


2.      调用DAO类方法时出错

function modify(){

   //alert("hello111");

   varvoxsjbxx = {   

          xsxh   :document.getElementById("xsxh").value,

          xsxm   : document.getElementById("xsxm").value,

          xsnl   : document.getElementById("xsnl").value,

          xsxb   : document.getElementById("xsxb").value

      };

     //alert("hello");

     xs_jbxxService.update(voxsjbxx);

}


以上程序段就是调用DAO函数进行增删查改的具体例子,在service类中的程序段是:


public voidupdate(XS_jbxx vojbxx)throwsException {

        dao.update(vojbxx);

   }


需要注意是是中括号类最后一行没有逗号,括号外有分号。

原创粉丝点击