I need to print the sql query with CriteriaQuery
. The code is:
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<Student> query = cb.createQuery(Student.class);
......
//other operantion
query.select(from);
query.where(predicateList.toArray(new Predicate[] {}));
TypedQuery<Student> exec = em.createQuery(query); //here in debug it prints the name of the object
resultList = exec.getResultList();
In my persistence I put:
The problem is that the debugt console it doesn't print the sql of CriteriaQuery
but only the name of object
Anyone can help me ho can I resolve my problem