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

sqlg3.annotations.Call 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 CallableStatement call should be generated.
 * CallableStatement template is taken from preceding javadoc comments.
 * 

* Example: *

 * String[] name = new String[1];
 * String[] value = new String[1];
 * int idParam = ...;
 * /**
 *  * BEGIN
 *  *   SELECT name, value
 *  *     INTO :>name, :>value
 *  *     FROM table
 *  *    WHERE id = :idParam
 *  * END;
 *  */
 * @Call Object[] ret = null;
 * // now name[0] and value[0] contain selected values
 * // also ret.length == 2, ret[0] == name[0] and ret[1] == value[0]
 * 
* Preprocessor generates code required to call statement with supplied 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 Call { }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy