0

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

Jérôme Radix
  • 10,285
  • 4
  • 34
  • 40
Doppu
  • 433
  • 2
  • 5
  • 14
  • See [the following](https://stackoverflow.com/questions/46423209/find-native-sql-query-from-typedquery#59507282) – g00se Mar 31 '23 at 15:09

0 Answers0