Permalink
Browse files

[#1406] Compilation errors in generated source code when Postgres stored

procedure parameter is called "NAME"
  • Loading branch information...
1 parent 74205af commit 7d7aa5049d3c15b12527c1fcdf364f837943d56a @lukaseder lukaseder committed May 10, 2012
@@ -46,6 +46,7 @@
import java.util.Set;
import org.jooq.Record;
+import org.jooq.impl.AbstractRoutine;
import org.jooq.impl.TableRecordImpl;
import org.jooq.impl.UDTRecordImpl;
import org.jooq.impl.UpdatableRecordImpl;
@@ -157,6 +158,11 @@ else if (definition instanceof ColumnDefinition) {
}
}
+ // [#1406] Disambiguate also procedure parameters
+ else if (definition instanceof ParameterDefinition) {
+ reserved = reservedColumns(AbstractRoutine.class);
+ }
+
if (reserved != null) {
if (reserved.contains(method)) {
return method + "_";
@@ -117,6 +117,24 @@
}
/**
+ * Call pg_catalog.pg_cursor
+ *
+ * @param name OUT parameter
+ * @param statement OUT parameter
+ * @param isHoldable OUT parameter
+ * @param isBinary OUT parameter
+ * @param isScrollable OUT parameter
+ * @param creationTime OUT parameter
+ * @throws org.jooq.exception.DataAccessException if something went wrong executing the query
+ */
+ public static org.jooq.util.postgres.pg_catalog.routines.PgCursor pgCursor(org.jooq.Configuration configuration) {
+ org.jooq.util.postgres.pg_catalog.routines.PgCursor p = new org.jooq.util.postgres.pg_catalog.routines.PgCursor();
+
+ p.execute(configuration);
+ return p;
+ }
+
+ /**
* No instances
*/
private Routines() {}
@@ -0,0 +1,83 @@
+/**
+ * This class is generated by jOOQ
+ */
+package org.jooq.util.postgres.pg_catalog.routines;
+
+/**
+ * This class is generated by jOOQ.
+ */
+@javax.annotation.Generated(value = {"http://www.jooq.org", "2.3.1-SNAPSHOT"},
+ comments = "This class is generated by jOOQ")
+public class PgCursor extends org.jooq.impl.AbstractRoutine<java.lang.Void> {
+
+ private static final long serialVersionUID = -747987068;
+
+
+ /**
+ * An uncommented item
+ */
+ public static final org.jooq.Parameter<java.lang.String> NAME = createParameter("name", org.jooq.impl.SQLDataType.CLOB);
+
+ /**
+ * An uncommented item
+ */
+ public static final org.jooq.Parameter<java.lang.String> STATEMENT = createParameter("statement", org.jooq.impl.SQLDataType.CLOB);
+
+ /**
+ * An uncommented item
+ */
+ public static final org.jooq.Parameter<java.lang.Boolean> IS_HOLDABLE = createParameter("is_holdable", org.jooq.impl.SQLDataType.BOOLEAN);
+
+ /**
+ * An uncommented item
+ */
+ public static final org.jooq.Parameter<java.lang.Boolean> IS_BINARY = createParameter("is_binary", org.jooq.impl.SQLDataType.BOOLEAN);
+
+ /**
+ * An uncommented item
+ */
+ public static final org.jooq.Parameter<java.lang.Boolean> IS_SCROLLABLE = createParameter("is_scrollable", org.jooq.impl.SQLDataType.BOOLEAN);
+
+ /**
+ * An uncommented item
+ */
+ public static final org.jooq.Parameter<java.sql.Timestamp> CREATION_TIME = createParameter("creation_time", org.jooq.impl.SQLDataType.TIMESTAMP);
+
+ /**
+ * Create a new routine call instance
+ */
+ public PgCursor() {
+ super("pg_cursor", org.jooq.util.postgres.pg_catalog.PgCatalog.PG_CATALOG);
+
+ addOutParameter(NAME);
+ addOutParameter(STATEMENT);
+ addOutParameter(IS_HOLDABLE);
+ addOutParameter(IS_BINARY);
+ addOutParameter(IS_SCROLLABLE);
+ addOutParameter(CREATION_TIME);
+ }
+
+ public java.lang.String getName_() {
+ return getValue(NAME);
+ }
+
+ public java.lang.String getStatement() {
+ return getValue(STATEMENT);
+ }
+
+ public java.lang.Boolean getIsHoldable() {
+ return getValue(IS_HOLDABLE);
+ }
+
+ public java.lang.Boolean getIsBinary() {
+ return getValue(IS_BINARY);
+ }
+
+ public java.lang.Boolean getIsScrollable() {
+ return getValue(IS_SCROLLABLE);
+ }
+
+ public java.sql.Timestamp getCreationTime() {
+ return getValue(CREATION_TIME);
+ }
+}
@@ -7,7 +7,7 @@ jdbc.Password=test
generator=org.jooq.util.DefaultGenerator
generator.database=org.jooq.util.postgres.PostgresDatabase
-generator.database.includes=pg_namespace,pg_enum,pg_type,pg_class,pg_attribute,pg_proc,format_type,count
+generator.database.includes=pg_namespace,pg_enum,pg_type,pg_class,pg_attribute,pg_proc,format_type,count,pg_cursor
generator.database.excludes=
generator.generate.deprecated=false
generator.generate.instance-fields=true

0 comments on commit 7d7aa50

Please sign in to comment.