你给出的异常应该属于你自己框架的信息吧,没有多少参考价值。
使用Session.load()要确保数据一定存在,还是用get()吧;
或者直接session.delete("from INFO where ID = 1");

解决方案 »

  1.   

    错误提示信息为:
    Hibernate: select gyinfo0_.id as id0_, info0_.userid as userid0_, info0_.tit
    le as title0_,info0_.descript as descript0_ from Info info0_ where info0_.id=?请指点
      

  2.   

    id在数据库表中为bigint型
    在对象中为long型
      

  3.   

    我也在学习hibernate,不知道说的对不对.
    你删除的应该是整个对象,而不是一个id,所以应该为:
    Info info = (Info)session.load(Info.class,id); 
    session.delete(info);  
    或者还有一种删除记录的方法:
    info=(Info)sn.creatQuery("from Info as a where a.ID= '"+delId+"'").uniqueResult();
    sn.delete(info);另外想问一下大家:
    hibernate的creatSQLQuery()是不是只支持查询?好象增删改都不可以
      

  4.   

    creatSQLQuery()是执行sql语句的,不过稍微有些改动,里面什么SQL语句都可以写