- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Contributes a comment appended to SQL statements at execution time.
The comment is appended after all statement processing and caching, immediately before the statement is prepared, so per-execution content such as the current trace context reaches the database without affecting Storm's template cache. Database-side diagnostics — slow query logs, statement views — then carry the comment, correlating captured statements back to the execution that issued them.
Commenters are configured per ORM template via the template builder; they are deliberately not discovered
through the ServiceLoader mechanism. Note that a per-execution comment changes the statement text on
every call, which defeats driver-side and server-side prepared statement caching; enable selectively.
- Since:
- 1.13
-
Method Summary
-
Method Details
-
comment
Returns the comment content for the statement that is about to execute, without comment delimiters, or empty when no comment applies. The content must not contain the comment terminator sequence (asterisk followed by slash) or semicolons; following the sqlcommenter convention, values are URL-encoded, which escapes both. The framework pads the emitted comment with spaces, so leading executable-comment and optimizer-hint markers are never interpreted.- Returns:
- the comment content, such as
traceparent='00-4bf92f35-00f067aa-01'.
-