private static Field<Void> foo(String param) {
return DSL.field("ext.foo({0}, {1}, {2})", Void.class, DSL.val(param));
}
org.jooq.exception.SQLDialectNotSupportedException: Type class java.lang.Void is not supported in dialect DEFAULT
at org.jooq.impl.DefaultDataType.getDataType(DefaultDataType.java:803)
at org.jooq.impl.DefaultDataType.getDataType(DefaultDataType.java:747)
at org.jooq.impl.DSL.getDataType(DSL.java:16970)
at org.jooq.impl.DSL.field(DSL.java:7626)
public static final SQLDialect SQL_DIALECT = SQLDialect.POSTGRES_9_5;
private static final DefaultDataType<Void> VOID = new DefaultDataType<>(
SQL_DIALECT, Void.class, "VOID");
private static Field<Void> foo(String param) {
return DSL.field("ext.foo({0}, {1}, {2})", VOID, DSL.val(param));
}
I have some questions about calling a custom postgresql function:1) I tried using DSL.field to call this postgresql sql function that return VOID, as follows:private static Field<Void> foo(String param) {
return DSL.field("ext.foo({0}, {1}, {2})", Void.class, DSL.val(param));
}But I get this exception from creating the field:
org.jooq.exception.SQLDialectNotSupportedException: Type class java.lang.Void is not supported in dialect DEFAULT
at org.jooq.impl.DefaultDataType.getDataType(DefaultDataType.java:803)
at org.jooq.impl.DefaultDataType.getDataType(DefaultDataType.java:747)
at org.jooq.impl.DSL.getDataType(DSL.java:16970)
at org.jooq.impl.DSL.field(DSL.java:7626)What am I doing wrong?
2) Would DSL.function be more appropriate to use instead of DSL.field in question # 1? I wasn't sure how to pass in my argument using DSL.function.
3) In question #1, is there a way to bind the schema name instead of hardcoding it in the sql? Or is putting it in the sql the best/only way?
DSL.field("{0}.foo({1}, {2}, {3})", schema(name("ext")), val(...), val(...), val(...));
DSL.field("{0}({1}, {2}, {3})", name("ext", "foo"), val(...), val(...), val(...));
--You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.