sqlg2
Annotation Type Prepare


@Retention(value=SOURCE)
@Target(value=LOCAL_VARIABLE)
public @interface Prepare

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 Query.