public interface Aggregate
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.Object value)
This method is called once for each row.
|
int |
getInternalType(int[] inputTypes)
This method must return the H2 data type,
Value ,
of the aggregate function, given the H2 data type of the input data. |
java.lang.Object |
getResult()
This method returns the computed aggregate value.
|
default void |
init(java.sql.Connection conn)
This method is called when the aggregate function is used.
|
default void init(java.sql.Connection conn) throws java.sql.SQLException
conn
- a connection to the databasejava.sql.SQLException
- on SQL exceptionint getInternalType(int[] inputTypes) throws java.sql.SQLException
Value
,
of the aggregate function, given the H2 data type of the input data.
The method should check here if the number of parameters
passed is correct, and if not it should throw an exception.inputTypes
- the H2 data type of the parameters,java.sql.SQLException
- if the number/type of parameters passed is incorrectvoid add(java.lang.Object value) throws java.sql.SQLException
value
- the value(s) for this rowjava.sql.SQLException
- on failurejava.lang.Object getResult() throws java.sql.SQLException
java.sql.SQLException
- on failure