Acces to MappedStatement from Interceptor

49 views
Skip to first unread message

Nicolas Gouteux

unread,
Oct 19, 2022, 5:53:51 AM10/19/22
to mybatis-user
Unless I am wrong, there is no way to get hold of the MappedStatement from within the Interceptor API. I think it would be great to expose this, in order for instance to find a key for queries when recording queries for instance...

Jeff Butler

unread,
Oct 19, 2022, 6:15:44 AM10/19/22
to mybati...@googlegroups.com
This is a very old example of an interceptor that prints SQL before it is executed. It shows how to access the MappedStatement. I think (hope) it still works: https://gist.github.com/jeffgbutler/a87f83754061eaa686abefb8016dde0a

Jeff Butler



On Wed, Oct 19, 2022 at 5:53 AM 'Nicolas Gouteux' via mybatis-user <mybati...@googlegroups.com> wrote:
Unless I am wrong, there is no way to get hold of the MappedStatement from within the Interceptor API. I think it would be great to expose this, in order for instance to find a key for queries when recording queries for instance...

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/5ed8a4ff-7e91-4123-880b-61bcfa698759n%40googlegroups.com.

Nicolas Gouteux

unread,
Oct 20, 2022, 3:36:08 AM10/20/22
to mybatis-user
Thanks a lot, Jeff. This works exactly as I want! 

Regards
Nicolas

Reply all
Reply to author
Forward
0 new messages