All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sqlg3.annotations.Sql Maven / Gradle / Ivy

Go to download

SQLG is a preprocessor and a library that uses code generation to simplify writing JDBC code

There is a newer version: 3.1
Show newest version
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 { }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy