hibernate的session获取:
Session session = this.getSessionFactory().getCurrentSession();
creatQuery() -----查询所有
Query query = session.createQuery("select count(v) from "+this.type.getSimpleName()+" v "); long totle = (long)query.uniqueResult();