代码如下: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.h