@Documented @Retention(value=RUNTIME) @Target(value=METHOD) public @interface QuerySqlFunction
CacheConfiguration.setSqlFunctionClasses(Class[])
.
Example usage:
public class MyFunctions { @QuerySqlFunction public static int sqr(int x) { return x * x; } } // Register. indexing.setSqlFunctionClasses(MyFunctions.class); // And use in queries. cache.queries().createSqlFieldsQuery("select sqr(2) where sqr(1) = 1");
For more information about H2 custom functions please refer to H2 documentation.
Modifier and Type | Optional Element and Description |
---|---|
String |
alias
Specifies alias for the function to be used form SQL queries.
|
boolean |
deterministic
Specifies if the function is deterministic (result depends only on input parameters).
|
public abstract String alias
public abstract boolean deterministic
Deterministic function is a function which always returns the same result assuming that input parameters are the same.
true
If function is deterministic, false
otherwise.
GridGain In-Memory Computing Platform : ver. 8.9.14 Release Date : November 5 2024