I think this is a simple question, although I do not know how to solve it.
In a spring / Hibernate application, I need to show a query executed by a criterion.
I know that I can use the show_sql property and write queries using log4j or any other logging structure, but I need a higher level of logging.
I have such a method
public void searchIntegrationClient(IntegrationClientSearchCommand integrationClientSearchCommand,PartialList<IntegrationClient> partialList) { Session session = getSession(); Criteria pageCriteria=session.createCriteria(IntegrationClient.class); if(StringUtil.isNotEmpty(integrationClientSearchCommand.getNameCmd())){ pageCriteria.add(Restrictions.like("name", integrationClientSearchCommand.getNameCmd(), MatchMode.START)); }
Do I need, before fulfilling the .list criterion, to show the query that will be executed?
Is there any utility class in api criteria to show the request as I want?
Thnx in advance
source share