Hi,
Okay I think I understand. Just to be fully clear, I have outlined what I
believe to be the procedure below. Can you confirm that it works?
- I will be writing my classes using Netbeans, of which two of the java
files will be structured as below**. The other two would just be
implementations of the AggregateFunction interface
- Compile the class files with javac
- Place the class files inside the jar
**
CREATE ALIAS MY_FUNCTION AS $$
String myFunc(String value) {
return new String(value).funcMethods().toString();
}
$$;
On Friday, November 16, 2018 at 10:02:39 AM UTC-5, Evgenij Ryazanov wrote:
>
> Hello.
>
> Both org.h2.api.AggregateFunction and better org.h2.api.Aggregate
> interfaces are for user-defined aggregate functions. They should not be
> placed inside H2 sources and do not require modification of H2. You need to
> write and compile your implementation of one of these interfaces, place it
> in classpath of your application and register it with CREATE AGGREGATE
> command under some name that will not conflict with built-in functions. H2
> will load it for this specific database.
>
> If you want to add some aggregate function to H2 itself take a look on
> org.h2.expression.aggregate.Aggregate class instead. However, H2 has both
> MEDIAN and MODE aggregates, so choose some missing functionality instead.
>
--
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 https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.