在网上找的尚硅谷的教学视频
其中有添加权限一段
String hql="select count(*) from Right r where r.rightUrl=?";
//此处不能用integer只能Long
Long count=(Long) this.uniqueResult(hql, url);
System.out.println(count);
下面是uniqueResult(hql, url)方法
public Object uniqueResult(String hql,Object...objects){
return dao.uniqueResult(hql, objects);
}