|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=SOURCE) @Target(value=LOCAL_VARIABLE) public @interface Sql
Annotation for local variables marking that variable's value should be taken
from comments (as a string). When extracting string from comments following
replacements are made:
"a &b c"
to
"a " + b + " c"
(i.e. variable substitution is performed).
Example:
String table = "TABLE"; /** * SELECT NAME, VALUE * FROM &table * WHERE ID = ? */ @Sql String sql = null;
Since Sql annotation works only with text (no parameters allowed), usually it's more convenient to use
Query
annotation to encapsulate both SQL text and its parameters into one entity.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |