select aclState&1,  aclState&2 from t_acl;  对应实体ACL。这条语句用hibernate怎么写?不是createSQLQuery这种。还有我用
hibernateTemplate怎么不能getSession(),Api上有这个方法。谢谢

解决方案 »

  1.   

    Query query=this.hibernateTemplate.getSessionFactory().getCurrentSession().createQuery("select aclState&1,aclState&2 from t_acl");
      

  2.   

    我的意思是用HQL怎么写,还有hibernateTemplate.getSession()这个怎么不行。
      

  3.   

    hibernateTemplate.getSessionFactory().getCurrentSession();
    hibernateTemplate.getSessionFactory().openSession();
    以上是从连接池中获得连接
    hibernateTemplate.getSession()貌似不是从连接池中获得