public interface Aggregate
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(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. |
Object |
getResult()
This method returns the computed aggregate value.
|
default void |
init(Connection conn)
This method is called when the aggregate function is used.
|
default void init(Connection conn) throws SQLException
conn - a connection to the databaseSQLException - on SQL exceptionint getInternalType(int[] inputTypes)
throws 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,SQLException - if the number/type of parameters passed is incorrectvoid add(Object value) throws SQLException
value - the value(s) for this rowSQLException - on failureObject getResult() throws SQLException
SQLException - on failureCopyright © 2022. All rights reserved.