hibernate更新数据方法小结
代码如下:Usertable user=null; Session session=HibernateSessionFactory.getSession(); String sql=”from Usertable as user where user.username=?”; Query q=session.createQuery(sql); q.setString(0,username); List l=q.list(); Iterator ite=l.iterator(); if(ite.hasNext()){ user=(Usertable)ite.next(); } return us
用户评论