When configured Hibernate’s slow query log, the outcome doesn't have the query printed. Instead, it prints the statement number.
[2022-02-08 16:48:01.302] [ForkJoinPool.commonPool-worker-5] INFO org.hibernate.SQL_SLOW@logSlowQuery:183 - SlowQuery: 82 milliseconds. SQL: 'HikariProxyPreparedStatement@1198569055 wrapping STMT0001'
Would it be possible to return the query as opposed to name in AS400JDBCStatement.toString() ?
Sorry, that is not possible. The method is already defined as follows.
The statement name could be used in other ways by other applications, so making the change could break other applications.