sqlg3.annotations.Sql Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sqlg3-runtime Show documentation
Show all versions of sqlg3-runtime Show documentation
SQLG is a preprocessor and a library that uses code generation to simplify writing JDBC code
package sqlg3.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 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
* {@link sqlg3.runtime.QueryPiece} annotation to encapsulate both SQL text and its parameters into one entity.
*/
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.LOCAL_VARIABLE)
public @interface Sql {
}