Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to log the sql query generated behind the scene from querydsl using mysemma

Any optimal way to show sql queries which are generated automatically while using querydsl of mysemma, so that these sql queries can be viewed easily and debugging of sql query becomes easy while working on querydsl.

For Example : from(qCustomer).where(qCustomer.custId.eq("1"));

I need to know the sql generated behind the scene and want to log so that I can debug my applications easily.

like image 570
InvincibleCoder Avatar asked Jan 04 '17 16:01

InvincibleCoder


1 Answers

Spring boot users, add below to application.properties or equivalent yaml file to enable QueryDsl logs.

logging.level.com.querydsl.sql=DEBUG

Reference - AbstractSQLQuery's logQuery()

like image 188
masT Avatar answered Sep 21 '22 10:09

masT