息: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to com.miracle.dm.doc.catalog.model.DocCatalogInfo 原来的查询语句: String sql = "select a.* from tb_doc_catalog a where a.cat_code like '"+catCode+"%'";Session session = this…
HQL查询: public Object query(String name){ Session s=null; try{ s=HibernateSessionFactory.getSession(); //String hql="from User where name=?"; //Query q=s.createQuery(hql); //q.setString(0, name); String hql="from User where name=:name";…