diff --git a/jOOQ-meta/src/main/java/org/jooq/util/h2/H2Database.java b/jOOQ-meta/src/main/java/org/jooq/util/h2/H2Database.java index 945535282a..4b6240692d 100644 --- a/jOOQ-meta/src/main/java/org/jooq/util/h2/H2Database.java +++ b/jOOQ-meta/src/main/java/org/jooq/util/h2/H2Database.java @@ -244,6 +244,9 @@ public class H2Database extends AbstractDatabase { .from(FUNCTION_ALIASES) .leftOuterJoin(TYPE_INFO) .on(FunctionAliases.DATA_TYPE.equal(TypeInfo.DATA_TYPE)) + // [#1256] TODO implement this correctly. Not sure if POS = 0 + // is the right predicate to rule out duplicate entries in TYPE_INFO + .and(TypeInfo.POS.equal(0)) .where(FunctionAliases.ALIAS_SCHEMA.in(getInputSchemata())) .and(FunctionAliases.RETURNS_RESULT.in((short) 1, (short) 2)) .orderBy(FunctionAliases.ALIAS_NAME).fetch()) { diff --git a/jOOQ-test/src/org/jooq/test/h2/F.java b/jOOQ-test/src/org/jooq/test/h2/F.java index 885cae1990..820036ed3f 100644 --- a/jOOQ-test/src/org/jooq/test/h2/F.java +++ b/jOOQ-test/src/org/jooq/test/h2/F.java @@ -124,6 +124,10 @@ public class F { return 1000 * p1 + 100 * p2 + p4; } + public static String f1256(String string) { + return string; + } + public static Integer fNumber(Integer n) { return n; } diff --git a/jOOQ-test/src/org/jooq/test/h2/create.sql b/jOOQ-test/src/org/jooq/test/h2/create.sql index cd5d7a1a3b..3b70b683d5 100644 --- a/jOOQ-test/src/org/jooq/test/h2/create.sql +++ b/jOOQ-test/src/org/jooq/test/h2/create.sql @@ -9,6 +9,7 @@ DROP ALIAS IF EXISTS f_author_exists/ DROP ALIAS IF EXISTS f_one/ DROP ALIAS IF EXISTS f_number/ DROP ALIAS IF EXISTS f317/ +DROP ALIAS IF EXISTS f1256/ DROP ALIAS IF EXISTS p_create_author/ DROP ALIAS IF EXISTS p_create_author_by_name/ DROP ALIAS IF EXISTS f_get_one_cursor/ @@ -384,6 +385,7 @@ SELECT * FROM t_book CREATE ALIAS f_one FOR "org.jooq.test.h2.F.fOne";/ CREATE ALIAS f_number FOR "org.jooq.test.h2.F.fNumber";/ CREATE ALIAS f317 FOR "org.jooq.test.h2.F.f317";/ +CREATE ALIAS f1256 FOR "org.jooq.test.h2.F.f1256";/ CREATE ALIAS f_arrays1 FOR "org.jooq.test.h2.F.f_arrays1";/ CREATE ALIAS f_arrays2 FOR "org.jooq.test.h2.F.f_arrays2";/ CREATE ALIAS f_arrays3 FOR "org.jooq.test.h2.F.f_arrays3";/ diff --git a/jOOQ-test/src/org/jooq/test/h2/generatedclasses/Routines.java b/jOOQ-test/src/org/jooq/test/h2/generatedclasses/Routines.java index 1c38d273f7..5d7a5b22a9 100644 --- a/jOOQ-test/src/org/jooq/test/h2/generatedclasses/Routines.java +++ b/jOOQ-test/src/org/jooq/test/h2/generatedclasses/Routines.java @@ -10,6 +10,44 @@ package org.jooq.test.h2.generatedclasses; */ public final class Routines { + /** + * Call PUBLIC.F1256 + * + * @param p1 + * @throws org.jooq.exception.DataAccessException if something went wrong executing the query + */ + public static java.lang.String f1256(org.jooq.Configuration configuration, java.lang.String p1) { + org.jooq.test.h2.generatedclasses.routines.F1256 f = new org.jooq.test.h2.generatedclasses.routines.F1256(); + f.setP1(p1); + + f.execute(configuration); + return f.getReturnValue(); + } + + /** + * Get PUBLIC.F1256 as a field + * + * @param p1 + */ + public static org.jooq.Field f1256(java.lang.String p1) { + org.jooq.test.h2.generatedclasses.routines.F1256 f = new org.jooq.test.h2.generatedclasses.routines.F1256(); + f.setP1(p1); + + return f.asField(); + } + + /** + * Get PUBLIC.F1256 as a field + * + * @param p1 + */ + public static org.jooq.Field f1256(org.jooq.Field p1) { + org.jooq.test.h2.generatedclasses.routines.F1256 f = new org.jooq.test.h2.generatedclasses.routines.F1256(); + f.setP1(p1); + + return f.asField(); + } + /** * Call PUBLIC.F317 * diff --git a/jOOQ-test/src/org/jooq/test/h2/generatedclasses/routines/F1256.java b/jOOQ-test/src/org/jooq/test/h2/generatedclasses/routines/F1256.java new file mode 100644 index 0000000000..4f3377c11a --- /dev/null +++ b/jOOQ-test/src/org/jooq/test/h2/generatedclasses/routines/F1256.java @@ -0,0 +1,49 @@ +/** + * This class is generated by jOOQ + */ +package org.jooq.test.h2.generatedclasses.routines; + +/** + * This class is generated by jOOQ. + */ +public class F1256 extends org.jooq.impl.AbstractRoutine { + + private static final long serialVersionUID = 588776449; + + + /** + * An uncommented item + */ + public static final org.jooq.Parameter RETURN_VALUE = createParameter("RETURN_VALUE", org.jooq.impl.SQLDataType.VARCHAR); + + /** + * An uncommented item + */ + public static final org.jooq.Parameter P1 = createParameter("P1", org.jooq.impl.SQLDataType.VARCHAR); + + /** + * Create a new routine call instance + */ + public F1256() { + super("F1256", org.jooq.test.h2.generatedclasses.Public.PUBLIC, org.jooq.impl.SQLDataType.VARCHAR); + + setReturnParameter(RETURN_VALUE); + addInParameter(P1); + } + + /** + * Set the P1 parameter to the routine + */ + public void setP1(java.lang.String value) { + setValue(P1, value); + } + + /** + * Set the P1 parameter to the function + *

+ * Use this method only, if the function is called as a {@link org.jooq.Field} in a {@link org.jooq.Select} statement! + */ + public void setP1(org.jooq.Field field) { + setField(P1, field); + } +}