I cannot get Hibernate to log the LIMIT parts of the SQL query. Regular parameter binding is logging as expected, only the LIMIT value(s) binding is not logging.
Code is fairly simple:
TypedQuery<UserEntity> query = entityManager
.createQuery("SELECT u from UserEntity u WHERE u.email LIKE :domain", UserEntity.class);
query.setParameter("domain", "%test%");
query.setFirstResult(startIndex);
query.setMaxResults(count);
List<UserEntity> users = query.getResultList();
Which generates the following logs. As you can see, regular parameter bindings are logged with no issue, but there are no log lines for limit binding.
Hibernate:
select
userentity0_.id as id1_53_,
userentity0_.created_at as created_2_53_,
userentity0_.dob as dob3_53_,
userentity0_.email as email4_53_,
userentity0_.fullname as fullname5_53_,
userentity0_.mobile as mobile6_53_,
userentity0_.product_id as product_7_53_
from
user_entity userentity0_
where
userentity0_.email_id like ? limit ?
TRACE o.h.type.descriptor.sql.BasicBinder : binding parameter [1] as [VARCHAR] - [%test%]
I've searched SO extensively, none of the regular property values seem to fix this issue and no other questions seem directed at this exact issue
Possibly relevant details:
- Hibernate 5.4.27.Final
- Dialect org.hibernate.dialect.MySQL5InnoDBDialect
- Slf4j
- Spring Boot 2.2.13.RELEASE