sqlg3.annotations.Prepare 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 PreparedStatement to be generated.
* SQL query is taken from preceding javadoc comments.
*
* Example:
*
* int idParam = ...;
* /**
* * SELECT name, value
* * FROM table
* * WHERE id = :idParam
* */
* @Prepare PreparedStatement stmt = null;
*
* Preprocessor generates code required to prepare statement and set its parameters.
*
* Note that parameters referenced
* in query (as :paramName
) should be accessible as variables in the current scope.
*
* You can use string and query substitution in comments, see {@link sqlg3.runtime.QueryPiece}.
*/
@Retention(RetentionPolicy.SOURCE)
@Target(ElementType.LOCAL_VARIABLE)
public @interface Prepare {
}