Permalink
Browse files

[#1407] Compilation errors in generated source code when Postgres

data-type is "any" (with quotes!)
  • Loading branch information...
1 parent aeb8765 commit 74205afc532320ee9ef2de36d980305659e88e27 @lukaseder lukaseder committed May 10, 2012
View
8 jOOQ-codegen/src/main/java/org/jooq/util/DefaultGenerator.java
@@ -2979,8 +2979,8 @@ else if (db.getEnum(schema, u) != null) {
String typeClass =
"org.jooq.util." +
db.getDialect().getName().toLowerCase() +
- "."+
- db.getDialect().getName()+
+ "." +
+ db.getDialect().getName() +
"DataType";
sb.append(typeClass);
@@ -3007,14 +3007,14 @@ else if (db.getEnum(schema, u) != null) {
// Mostly because of unsupported data types
catch (SQLDialectNotSupportedException e) {
sb.append("getDefaultDataType(\"");
- sb.append(t);
+ sb.append(t.replace("\"", "\\\""));
sb.append("\")");
}
// More unsupported data types
catch (ReflectException e) {
sb.append("getDefaultDataType(\"");
- sb.append(t);
+ sb.append(t.replace("\"", "\\\""));
sb.append("\")");
}
}
View
4 jOOQ-meta/src/main/java/org/jooq/util/postgres/pg_catalog/PgCatalog.java
@@ -6,11 +6,11 @@
/**
* This class is generated by jOOQ.
*/
-@javax.annotation.Generated(value = {"http://www.jooq.org", "2.0.6"},
+@javax.annotation.Generated(value = {"http://www.jooq.org", "2.3.1-SNAPSHOT"},
comments = "This class is generated by jOOQ")
public class PgCatalog extends org.jooq.impl.SchemaImpl {
- private static final long serialVersionUID = -1216270135;
+ private static final long serialVersionUID = -371905234;
/**
* The singleton instance of pg_catalog
View
17 jOOQ-meta/src/main/java/org/jooq/util/postgres/pg_catalog/PgCatalogFactory.java
@@ -6,11 +6,11 @@
/**
* This class is generated by jOOQ.
*/
-@javax.annotation.Generated(value = {"http://www.jooq.org", "2.0.6"},
+@javax.annotation.Generated(value = {"http://www.jooq.org", "2.3.1-SNAPSHOT"},
comments = "This class is generated by jOOQ")
public class PgCatalogFactory extends org.jooq.util.postgres.PostgresFactory {
- private static final long serialVersionUID = -2055956907;
+ private static final long serialVersionUID = 1626557035;
/**
* Create a factory with a connection
@@ -19,6 +19,8 @@
*/
public PgCatalogFactory(java.sql.Connection connection) {
super(connection);
+
+ initDefaultSchema();
}
/**
@@ -29,5 +31,16 @@ public PgCatalogFactory(java.sql.Connection connection) {
*/
public PgCatalogFactory(java.sql.Connection connection, org.jooq.conf.Settings settings) {
super(connection, settings);
+
+ initDefaultSchema();
+ }
+
+ /**
+ * Initialise the render mapping's default schema.
+ * <p>
+ * For convenience, this schema-specific factory should override any pre-existing setting
+ */
+ private final void initDefaultSchema() {
+ org.jooq.conf.SettingsTools.getRenderMapping(getSettings()).setDefaultSchema(org.jooq.util.postgres.pg_catalog.PgCatalog.PG_CATALOG.getName());
}
}
View
62 jOOQ-meta/src/main/java/org/jooq/util/postgres/pg_catalog/Routines.java
@@ -8,11 +8,71 @@
*
* Convenience access to all stored procedures and functions in pg_catalog
*/
-@javax.annotation.Generated(value = {"http://www.jooq.org", "2.0.6"},
+@javax.annotation.Generated(value = {"http://www.jooq.org", "2.3.1-SNAPSHOT"},
comments = "This class is generated by jOOQ")
public final class Routines {
/**
+ * Call pg_catalog.count
+ *
+ * @throws org.jooq.exception.DataAccessException if something went wrong executing the query
+ */
+ public static java.lang.Long count2(org.jooq.Configuration configuration) {
+ org.jooq.util.postgres.pg_catalog.routines.Count2 f = new org.jooq.util.postgres.pg_catalog.routines.Count2();
+
+ f.execute(configuration);
+ return f.getReturnValue();
+ }
+
+ /**
+ * Get pg_catalog.count as a field
+ *
+ */
+ public static org.jooq.Field<java.lang.Long> count2() {
+ org.jooq.util.postgres.pg_catalog.routines.Count2 f = new org.jooq.util.postgres.pg_catalog.routines.Count2();
+
+ return f.asField();
+ }
+
+ /**
+ * Call pg_catalog.count
+ *
+ * @param __1
+ * @throws org.jooq.exception.DataAccessException if something went wrong executing the query
+ */
+ public static java.lang.Long count1(org.jooq.Configuration configuration, java.lang.Object __1) {
+ org.jooq.util.postgres.pg_catalog.routines.Count1 f = new org.jooq.util.postgres.pg_catalog.routines.Count1();
+ f.set__1(__1);
+
+ f.execute(configuration);
+ return f.getReturnValue();
+ }
+
+ /**
+ * Get pg_catalog.count as a field
+ *
+ * @param __1
+ */
+ public static org.jooq.Field<java.lang.Long> count1(java.lang.Object __1) {
+ org.jooq.util.postgres.pg_catalog.routines.Count1 f = new org.jooq.util.postgres.pg_catalog.routines.Count1();
+ f.set__1(__1);
+
+ return f.asField();
+ }
+
+ /**
+ * Get pg_catalog.count as a field
+ *
+ * @param __1
+ */
+ public static org.jooq.Field<java.lang.Long> count1(org.jooq.Field<java.lang.Object> __1) {
+ org.jooq.util.postgres.pg_catalog.routines.Count1 f = new org.jooq.util.postgres.pg_catalog.routines.Count1();
+ f.set__1(__1);
+
+ return f.asField();
+ }
+
+ /**
* Call pg_catalog.format_type
*
* @param __1
View
2 jOOQ-meta/src/main/java/org/jooq/util/postgres/pg_catalog/Tables.java
@@ -8,7 +8,7 @@
*
* Convenience access to all tables in pg_catalog
*/
-@javax.annotation.Generated(value = {"http://www.jooq.org", "2.0.6"},
+@javax.annotation.Generated(value = {"http://www.jooq.org", "2.3.1-SNAPSHOT"},
comments = "This class is generated by jOOQ")
public final class Tables {
View
55 jOOQ-meta/src/main/java/org/jooq/util/postgres/pg_catalog/routines/Count1.java
@@ -0,0 +1,55 @@
+/**
+ * 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 Count1 extends org.jooq.impl.AbstractRoutine<java.lang.Long> {
+
+ private static final long serialVersionUID = -772102665;
+
+
+ /**
+ * An uncommented item
+ */
+ public static final org.jooq.Parameter<java.lang.Long> RETURN_VALUE = createParameter("RETURN_VALUE", org.jooq.impl.SQLDataType.BIGINT);
+
+ /**
+ * An uncommented item
+ *
+ * The SQL type of this item ("any", any) could not be mapped.<br/>
+ * Deserialising this field might not work!
+ */
+ public static final org.jooq.Parameter<java.lang.Object> _1 = createParameter("_1", org.jooq.util.postgres.PostgresDataType.getDefaultDataType("\"any\""));
+
+ /**
+ * Create a new routine call instance
+ */
+ public Count1() {
+ super("count", org.jooq.util.postgres.pg_catalog.PgCatalog.PG_CATALOG, org.jooq.impl.SQLDataType.BIGINT);
+
+ setReturnParameter(RETURN_VALUE);
+ addInParameter(_1);
+ setOverloaded(true);
+ }
+
+ /**
+ * Set the <code>_1</code> parameter to the routine
+ */
+ public void set__1(java.lang.Object value) {
+ setValue(_1, value);
+ }
+
+ /**
+ * Set the <code>_1</code> parameter to the function
+ * <p>
+ * Use this method only, if the function is called as a {@link org.jooq.Field} in a {@link org.jooq.Select} statement!
+ */
+ public void set__1(org.jooq.Field<java.lang.Object> field) {
+ setField(_1, field);
+ }
+}
View
30 jOOQ-meta/src/main/java/org/jooq/util/postgres/pg_catalog/routines/Count2.java
@@ -0,0 +1,30 @@
+/**
+ * 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 Count2 extends org.jooq.impl.AbstractRoutine<java.lang.Long> {
+
+ private static final long serialVersionUID = 1180633735;
+
+
+ /**
+ * An uncommented item
+ */
+ public static final org.jooq.Parameter<java.lang.Long> RETURN_VALUE = createParameter("RETURN_VALUE", org.jooq.impl.SQLDataType.BIGINT);
+
+ /**
+ * Create a new routine call instance
+ */
+ public Count2() {
+ super("count", org.jooq.util.postgres.pg_catalog.PgCatalog.PG_CATALOG, org.jooq.impl.SQLDataType.BIGINT);
+
+ setReturnParameter(RETURN_VALUE);
+ setOverloaded(true);
+ }
+}
View
4 jOOQ-meta/src/main/java/org/jooq/util/postgres/pg_catalog/routines/FormatType.java
@@ -6,11 +6,11 @@
/**
* This class is generated by jOOQ.
*/
-@javax.annotation.Generated(value = {"http://www.jooq.org", "2.0.6"},
+@javax.annotation.Generated(value = {"http://www.jooq.org", "2.3.1-SNAPSHOT"},
comments = "This class is generated by jOOQ")
public class FormatType extends org.jooq.impl.AbstractRoutine<java.lang.String> {
- private static final long serialVersionUID = -1197259008;
+ private static final long serialVersionUID = -1785499997;
/**
View
21 jOOQ-meta/src/main/java/org/jooq/util/postgres/pg_catalog/tables/PgAttribute.java
@@ -6,11 +6,11 @@
/**
* This class is generated by jOOQ.
*/
-@javax.annotation.Generated(value = {"http://www.jooq.org", "2.0.6"},
+@javax.annotation.Generated(value = {"http://www.jooq.org", "2.3.1-SNAPSHOT"},
comments = "This class is generated by jOOQ")
public class PgAttribute extends org.jooq.impl.TableImpl<org.jooq.Record> {
- private static final long serialVersionUID = 2062334520;
+ private static final long serialVersionUID = -519027695;
/**
* The singleton instance of pg_catalog.pg_attribute
@@ -20,14 +20,9 @@
/**
* The class holding records for this type
*/
- private static final java.lang.Class<org.jooq.Record> __RECORD_TYPE = org.jooq.Record.class;
-
- /**
- * The class holding records for this type
- */
@Override
public java.lang.Class<org.jooq.Record> getRecordType() {
- return __RECORD_TYPE;
+ return org.jooq.Record.class;
}
/**
@@ -125,17 +120,11 @@
*/
public final org.jooq.TableField<org.jooq.Record, java.lang.String[]> ATTOPTIONS = createField("attoptions", org.jooq.impl.SQLDataType.CLOB.getArrayDataType(), this);
- /**
- * No further instances allowed
- */
- private PgAttribute() {
+ public PgAttribute() {
super("pg_attribute", org.jooq.util.postgres.pg_catalog.PgCatalog.PG_CATALOG);
}
- /**
- * No further instances allowed
- */
- private PgAttribute(java.lang.String alias) {
+ public PgAttribute(java.lang.String alias) {
super(alias, org.jooq.util.postgres.pg_catalog.PgCatalog.PG_CATALOG, org.jooq.util.postgres.pg_catalog.tables.PgAttribute.PG_ATTRIBUTE);
}
View
21 jOOQ-meta/src/main/java/org/jooq/util/postgres/pg_catalog/tables/PgClass.java
@@ -6,11 +6,11 @@
/**
* This class is generated by jOOQ.
*/
-@javax.annotation.Generated(value = {"http://www.jooq.org", "2.0.6"},
+@javax.annotation.Generated(value = {"http://www.jooq.org", "2.3.1-SNAPSHOT"},
comments = "This class is generated by jOOQ")
public class PgClass extends org.jooq.impl.TableImpl<org.jooq.Record> {
- private static final long serialVersionUID = 497846309;
+ private static final long serialVersionUID = -1753706892;
/**
* The singleton instance of pg_catalog.pg_class
@@ -20,14 +20,9 @@
/**
* The class holding records for this type
*/
- private static final java.lang.Class<org.jooq.Record> __RECORD_TYPE = org.jooq.Record.class;
-
- /**
- * The class holding records for this type
- */
@Override
public java.lang.Class<org.jooq.Record> getRecordType() {
- return __RECORD_TYPE;
+ return org.jooq.Record.class;
}
/**
@@ -165,17 +160,11 @@
*/
public final org.jooq.TableField<org.jooq.Record, java.lang.String[]> RELOPTIONS = createField("reloptions", org.jooq.impl.SQLDataType.CLOB.getArrayDataType(), this);
- /**
- * No further instances allowed
- */
- private PgClass() {
+ public PgClass() {
super("pg_class", org.jooq.util.postgres.pg_catalog.PgCatalog.PG_CATALOG);
}
- /**
- * No further instances allowed
- */
- private PgClass(java.lang.String alias) {
+ public PgClass(java.lang.String alias) {
super(alias, org.jooq.util.postgres.pg_catalog.PgCatalog.PG_CATALOG, org.jooq.util.postgres.pg_catalog.tables.PgClass.PG_CLASS);
}
View
21 jOOQ-meta/src/main/java/org/jooq/util/postgres/pg_catalog/tables/PgEnum.java
@@ -6,11 +6,11 @@
/**
* This class is generated by jOOQ.
*/
-@javax.annotation.Generated(value = {"http://www.jooq.org", "2.0.6"},
+@javax.annotation.Generated(value = {"http://www.jooq.org", "2.3.1-SNAPSHOT"},
comments = "This class is generated by jOOQ")
public class PgEnum extends org.jooq.impl.TableImpl<org.jooq.Record> {
- private static final long serialVersionUID = 1198881091;
+ private static final long serialVersionUID = 800254732;
/**
* The singleton instance of pg_catalog.pg_enum
@@ -20,14 +20,9 @@
/**
* The class holding records for this type
*/
- private static final java.lang.Class<org.jooq.Record> __RECORD_TYPE = org.jooq.Record.class;
-
- /**
- * The class holding records for this type
- */
@Override
public java.lang.Class<org.jooq.Record> getRecordType() {
- return __RECORD_TYPE;
+ return org.jooq.Record.class;
}
/**
@@ -40,17 +35,11 @@
*/
public final org.jooq.TableField<org.jooq.Record, java.lang.String> ENUMLABEL = createField("enumlabel", org.jooq.impl.SQLDataType.VARCHAR, this);
- /**
- * No further instances allowed
- */
- private PgEnum() {
+ public PgEnum() {
super("pg_enum", org.jooq.util.postgres.pg_catalog.PgCatalog.PG_CATALOG);
}
- /**
- * No further instances allowed
- */
- private PgEnum(java.lang.String alias) {
+ public PgEnum(java.lang.String alias) {
super(alias, org.jooq.util.postgres.pg_catalog.PgCatalog.PG_CATALOG, org.jooq.util.postgres.pg_catalog.tables.PgEnum.PG_ENUM);
}
View
21 jOOQ-meta/src/main/java/org/jooq/util/postgres/pg_catalog/tables/PgNamespace.java
@@ -6,11 +6,11 @@
/**
* This class is generated by jOOQ.
*/
-@javax.annotation.Generated(value = {"http://www.jooq.org", "2.0.6"},
+@javax.annotation.Generated(value = {"http://www.jooq.org", "2.3.1-SNAPSHOT"},
comments = "This class is generated by jOOQ")
public class PgNamespace extends org.jooq.impl.TableImpl<org.jooq.Record> {
- private static final long serialVersionUID = -1774545004;
+ private static final long serialVersionUID = -1769943747;
/**
* The singleton instance of pg_catalog.pg_namespace
@@ -20,14 +20,9 @@
/**
* The class holding records for this type
*/
- private static final java.lang.Class<org.jooq.Record> __RECORD_TYPE = org.jooq.Record.class;
-
- /**
- * The class holding records for this type
- */
@Override
public java.lang.Class<org.jooq.Record> getRecordType() {
- return __RECORD_TYPE;
+ return org.jooq.Record.class;
}
/**
@@ -45,17 +40,11 @@
*/
public final org.jooq.TableField<org.jooq.Record, java.lang.String[]> NSPACL = createField("nspacl", org.jooq.impl.SQLDataType.VARCHAR.getArrayDataType(), this);
- /**
- * No further instances allowed
- */
- private PgNamespace() {
+ public PgNamespace() {
super("pg_namespace", org.jooq.util.postgres.pg_catalog.PgCatalog.PG_CATALOG);
}
- /**
- * No further instances allowed
- */
- private PgNamespace(java.lang.String alias) {
+ public PgNamespace(java.lang.String alias) {
super(alias, org.jooq.util.postgres.pg_catalog.PgCatalog.PG_CATALOG, org.jooq.util.postgres.pg_catalog.tables.PgNamespace.PG_NAMESPACE);
}
View
21 jOOQ-meta/src/main/java/org/jooq/util/postgres/pg_catalog/tables/PgProc.java
@@ -6,11 +6,11 @@
/**
* This class is generated by jOOQ.
*/
-@javax.annotation.Generated(value = {"http://www.jooq.org", "2.0.6"},
+@javax.annotation.Generated(value = {"http://www.jooq.org", "2.3.1-SNAPSHOT"},
comments = "This class is generated by jOOQ")
public class PgProc extends org.jooq.impl.TableImpl<org.jooq.Record> {
- private static final long serialVersionUID = 1574331687;
+ private static final long serialVersionUID = 26734556;
/**
* The singleton instance of pg_catalog.pg_proc
@@ -20,14 +20,9 @@
/**
* The class holding records for this type
*/
- private static final java.lang.Class<org.jooq.Record> __RECORD_TYPE = org.jooq.Record.class;
-
- /**
- * The class holding records for this type
- */
@Override
public java.lang.Class<org.jooq.Record> getRecordType() {
- return __RECORD_TYPE;
+ return org.jooq.Record.class;
}
/**
@@ -155,17 +150,11 @@
*/
public final org.jooq.TableField<org.jooq.Record, java.lang.String[]> PROACL = createField("proacl", org.jooq.impl.SQLDataType.VARCHAR.getArrayDataType(), this);
- /**
- * No further instances allowed
- */
- private PgProc() {
+ public PgProc() {
super("pg_proc", org.jooq.util.postgres.pg_catalog.PgCatalog.PG_CATALOG);
}
- /**
- * No further instances allowed
- */
- private PgProc(java.lang.String alias) {
+ public PgProc(java.lang.String alias) {
super(alias, org.jooq.util.postgres.pg_catalog.PgCatalog.PG_CATALOG, org.jooq.util.postgres.pg_catalog.tables.PgProc.PG_PROC);
}
View
21 jOOQ-meta/src/main/java/org/jooq/util/postgres/pg_catalog/tables/PgType.java
@@ -6,11 +6,11 @@
/**
* This class is generated by jOOQ.
*/
-@javax.annotation.Generated(value = {"http://www.jooq.org", "2.0.6"},
+@javax.annotation.Generated(value = {"http://www.jooq.org", "2.3.1-SNAPSHOT"},
comments = "This class is generated by jOOQ")
public class PgType extends org.jooq.impl.TableImpl<org.jooq.Record> {
- private static final long serialVersionUID = 867629277;
+ private static final long serialVersionUID = 1130750896;
/**
* The singleton instance of pg_catalog.pg_type
@@ -20,14 +20,9 @@
/**
* The class holding records for this type
*/
- private static final java.lang.Class<org.jooq.Record> __RECORD_TYPE = org.jooq.Record.class;
-
- /**
- * The class holding records for this type
- */
@Override
public java.lang.Class<org.jooq.Record> getRecordType() {
- return __RECORD_TYPE;
+ return org.jooq.Record.class;
}
/**
@@ -170,17 +165,11 @@
*/
public final org.jooq.TableField<org.jooq.Record, java.lang.String> TYPDEFAULT = createField("typdefault", org.jooq.impl.SQLDataType.CLOB, this);
- /**
- * No further instances allowed
- */
- private PgType() {
+ public PgType() {
super("pg_type", org.jooq.util.postgres.pg_catalog.PgCatalog.PG_CATALOG);
}
- /**
- * No further instances allowed
- */
- private PgType(java.lang.String alias) {
+ public PgType(java.lang.String alias) {
super(alias, org.jooq.util.postgres.pg_catalog.PgCatalog.PG_CATALOG, org.jooq.util.postgres.pg_catalog.tables.PgType.PG_TYPE);
}
View
2 jOOQ-test/configuration/org/jooq/configuration/lukas/postgres/pg_catalog.properties
@@ -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
+generator.database.includes=pg_namespace,pg_enum,pg_type,pg_class,pg_attribute,pg_proc,format_type,count
generator.database.excludes=
generator.generate.deprecated=false
generator.generate.instance-fields=true

0 comments on commit 74205af

Please sign in to comment.