Hi Noel,

Am Freitag, 27. Juni 2014 17:06:19 UTC+2 schrieb Noel Grandin:
>
> On Fri, Jun 27, 2014 at 4:48 PM, Lukas Eder <[email protected] 
> <javascript:>> wrote: 
> > - What exactly is the difference between org.h2.api.AggregateFunction 
> and 
> > org.h2.api.Aggregate? I don't really see the point of this distinction. 
>
> See the comment in the JavaDoc for AggregateFunction: 
>
> "Please note this interface only has limited support for data types. 
> If you need data types that don't have a corresponding SQL type (for 
> example GEOMETRY), then use the {@link Aggregate} interface" 
>

I've seen that Javadoc remark. Let me explain my confusion a bit more:

// This API has only *limited* support for data types:
public interface AggregateFunction {
    void init(Connection conn) throws SQLException;
    int getType(int[] inputTypes) throws SQLException;
    void add(Object value) throws SQLException;
    Object getResult() throws SQLException;
} 

// This API can handle all sorts of data types:
public interface Aggregate {
    void init(Connection conn) throws SQLException;
    int getInternalType(int[] inputTypes) throws SQLException;
    void add(Object value) throws SQLException;
    Object getResult() throws SQLException;
}

The whole difference in how these interfaces seem work is essentially 
contained in the fact that one interface calls the second method "getType", 
whereas the other calls it "getInternalType"

But I get it now. Interestingly, the "internal types" do not extend the 
JDBC type numbers, fair enough.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to