hibernate查询问题
String sql="select count(vd_rule) from userlogmalicious where 1=1 and eventtype='2' and createtime>='2013-09-01 00:00:00' and createtime<='2013-09-30 23:59:59' ";
m2=instanceUserlogeventreportmsgBeanDao.findCountByHQL(sql.toString());
public int findCount(String sql){
Object o= this.getSession().createSQLQuery(sql).uniqueResult();
return (o==null)?0:((BigInteger)o).intValue();
}
用sql查询,得到的数据一直为0,而直接用sql语句查数据库是有数据的,是不是hibernate查询的问题????