0
Criteria criteria = session.createCriteria(Student.class);
criteria.add(Restrictions.eq(STD_ID, stdId));
criteria.add(Restrictions.le(START_DATE, dateOfService));
criteria.add(Restrictions.ge(END_DATE, dateOfService));
results = criteria.list();

Is it possible to convert the criteria object to SQL query or while debugging in Eclipse is it possible to see the generated SQL query?

Mikhail Kholodkov
  • 23,642
  • 17
  • 61
  • 78
Ramesh
  • 1
  • 4

1 Answers1

1

It's impossible to do with criteria API, but there are some workarounds : How to get SQL from Hibernate Criteria API (*not* for logging)

ilya
  • 182
  • 1
  • 2
  • 9