2

I am using Criteria Query in my project. I have to the following SQL query

SELECT ARRAY(column_name) from table

I need to write this in Hibernate Criteria query. The current Criteria query code I am using is as follows

CriteriaBuilder cb = getSession().getCriteriaBuilder();
CriteriaQuery<Class> cq = cb.createQuery(Class.class);
Root<Class1> root = cq.from(Class1.class);
cq.select(root);
return getSession().createQuery(cq).getResultList(); 

Instead of cq.select(root) I need to have cq.select(array(column)). I have tried Tuple and Multiselect both did not work.

Joker
  • 81
  • 12

0 Answers0