HQL - difference between two same queries
问题 Why does this query work normal: Query query = session.createQuery("from Table tab"); And this query: Query query = session .createQuery("select tab.col1, tab.col2, tab.col3 from Table tab"); And that's what I'm doing with both queries: dataList = query.list(); for (Table item : dataList) { System.out.println(item.getCol1(); } reports: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to table.Table at test.TestCriteria.main(TestCriteria.java:35) Could you help? Table is