String hql= "from bean.User u where u.name=? and u.password=?"
this.getHibernateTemplate().find(hql, new String[]{"test", "123"});
String queryString = "select count(*) from bean.User u where u.name=:myName and u.password=:myPassword";
String[] paramName= new String[]{"myName", "myPassword"};
String[] value= new String[]{"xiyue", "123"};
this.getHibernateTemplate().findByNamedParam(queryString, paramName, value);