It seems the @LIKE processing, where it generates an = comparison instead of a LIKE when possible, is broken in the presence of escaped wildcard characters.
If you provide test\_test as a parameter, ElSqlConfig.isLikeWildcard(value) will see the escaped wildcard, and return that it is not a 'like wildcard'. Consequently, LikeSqlFragment generates a comparison using the = operator. So you SQL ends up as:
SELECT * FROM x WHERE a = 'test\_test'
This searches for test\_test and not for test_test.
If you specify test_test, it will see the wildcard and generate:
SELECT * FROM x WHERE a LIKE 'test_test'
which matches more than it should. So whether you pass escaped or unescaped parameters, the end result is never what you want.
I am not sure what a good way to fix this would be. The only possible way seems to be to always generate a LIKE, or to let the LikeSqlFragment unescape the parameter if it does not generate a LIKE, but that feels like data it should not be touching.