Merge branch 'master' of git@github.com:jOOQ/jOOQ.git
This commit is contained in:
commit
f9f0b33962
@ -9,7 +9,7 @@
|
||||
|
||||
<groupId>org.jooq</groupId>
|
||||
<artifactId>jooq-codegen-maven-example</artifactId>
|
||||
<version>2.3.0</version>
|
||||
<version>2.4.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>jOOQ Codegen Maven</name>
|
||||
@ -51,7 +51,7 @@
|
||||
<dependency>
|
||||
<groupId>org.jooq</groupId>
|
||||
<artifactId>jooq</artifactId>
|
||||
<version>2.3.0</version>
|
||||
<version>2.4.0-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
@ -106,7 +106,7 @@
|
||||
<plugin>
|
||||
<groupId>org.jooq</groupId>
|
||||
<artifactId>jooq-codegen-maven</artifactId>
|
||||
<version>2.3.0</version>
|
||||
<version>2.4.0-SNAPSHOT</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>exec1</id>
|
||||
|
||||
@ -6,12 +6,12 @@
|
||||
<version>7</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
<groupId>org.jooq</groupId>
|
||||
<artifactId>jooq-codegen-maven</artifactId>
|
||||
<version>2.3.0</version>
|
||||
<version>2.4.0-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
|
||||
<name>jOOQ Codegen Maven</name>
|
||||
<description>jOOQ effectively combines complex SQL, typesafety, source code generation, active records, stored procedures, advanced data types, and Java in a fluent, intuitive DSL.</description>
|
||||
<url>http://www.jooq.org</url>
|
||||
@ -35,7 +35,7 @@
|
||||
<system>Trac</system>
|
||||
<url>https://sourceforge.net/apps/trac/jooq/report/6</url>
|
||||
</issueManagement>
|
||||
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<name>Lukas Eder</name>
|
||||
@ -46,7 +46,7 @@
|
||||
<email>sander.plas@gmail.com</email>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
|
||||
<build>
|
||||
<defaultGoal>deploy</defaultGoal>
|
||||
<finalName>${project.artifactId}-${project.version}</finalName>
|
||||
@ -66,7 +66,7 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
@ -133,7 +133,7 @@
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-eclipse-plugin</artifactId>
|
||||
@ -160,7 +160,7 @@
|
||||
<dependency>
|
||||
<groupId>org.jooq</groupId>
|
||||
<artifactId>jooq-codegen</artifactId>
|
||||
<version>2.3.0</version>
|
||||
<version>2.4.0-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
<groupId>org.jooq</groupId>
|
||||
<artifactId>jooq-codegen</artifactId>
|
||||
<version>2.3.0</version>
|
||||
<version>2.4.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>jOOQ Codegen</name>
|
||||
@ -118,7 +118,7 @@
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-eclipse-plugin</artifactId>
|
||||
@ -134,7 +134,7 @@
|
||||
<system>Trac</system>
|
||||
<url>https://sourceforge.net/apps/trac/jooq/report/6</url>
|
||||
</issueManagement>
|
||||
|
||||
|
||||
<developers>
|
||||
<developer>
|
||||
<name>Lukas Eder</name>
|
||||
@ -150,14 +150,14 @@
|
||||
<dependency>
|
||||
<groupId>org.jooq</groupId>
|
||||
<artifactId>jooq</artifactId>
|
||||
<version>2.3.0</version>
|
||||
<version>2.4.0-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jooq</groupId>
|
||||
<artifactId>jooq-meta</artifactId>
|
||||
<version>2.3.0</version>
|
||||
<version>2.4.0-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
@ -2979,8 +2979,8 @@ public class DefaultGenerator implements Generator {
|
||||
String typeClass =
|
||||
"org.jooq.util." +
|
||||
db.getDialect().getName().toLowerCase() +
|
||||
"."+
|
||||
db.getDialect().getName()+
|
||||
"." +
|
||||
db.getDialect().getName() +
|
||||
"DataType";
|
||||
|
||||
sb.append(typeClass);
|
||||
@ -3007,14 +3007,14 @@ public class DefaultGenerator implements Generator {
|
||||
// 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("\")");
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,6 +46,7 @@ import java.util.Map;
|
||||
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 @@ class GeneratorStrategyWrapper extends AbstractGeneratorStrategy {
|
||||
}
|
||||
}
|
||||
|
||||
// [#1406] Disambiguate also procedure parameters
|
||||
else if (definition instanceof ParameterDefinition) {
|
||||
reserved = reservedColumns(AbstractRoutine.class);
|
||||
}
|
||||
|
||||
if (reserved != null) {
|
||||
if (reserved.contains(method)) {
|
||||
return method + "_";
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
<groupId>org.jooq</groupId>
|
||||
<artifactId>jooq-console</artifactId>
|
||||
<version>2.3.0</version>
|
||||
<version>2.4.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>jOOQ</name>
|
||||
@ -201,7 +201,7 @@
|
||||
<dependency>
|
||||
<groupId>org.jooq</groupId>
|
||||
<artifactId>jooq</artifactId>
|
||||
<version>2.3.0</version>
|
||||
<version>2.4.0-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
|
||||
<groupId>org.jooq</groupId>
|
||||
<artifactId>jooq-meta</artifactId>
|
||||
<version>2.3.0</version>
|
||||
<version>2.4.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>jOOQ Meta</name>
|
||||
@ -198,7 +198,7 @@
|
||||
<dependency>
|
||||
<groupId>org.jooq</groupId>
|
||||
<artifactId>jooq</artifactId>
|
||||
<version>2.3.0</version>
|
||||
<version>2.4.0-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
@ -6,11 +6,11 @@ package org.jooq.util.postgres.pg_catalog;
|
||||
/**
|
||||
* 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.4.0"},
|
||||
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 = 1109544775;
|
||||
|
||||
/**
|
||||
* The singleton instance of pg_catalog
|
||||
|
||||
@ -6,11 +6,11 @@ package org.jooq.util.postgres.pg_catalog;
|
||||
/**
|
||||
* 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.4.0"},
|
||||
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 = 1813233842;
|
||||
|
||||
/**
|
||||
* Create a factory with a connection
|
||||
@ -19,6 +19,8 @@ public class PgCatalogFactory extends org.jooq.util.postgres.PostgresFactory {
|
||||
*/
|
||||
public PgCatalogFactory(java.sql.Connection connection) {
|
||||
super(connection);
|
||||
|
||||
initDefaultSchema();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -29,5 +31,16 @@ public class PgCatalogFactory extends org.jooq.util.postgres.PostgresFactory {
|
||||
*/
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,10 +8,70 @@ package org.jooq.util.postgres.pg_catalog;
|
||||
*
|
||||
* 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.4.0"},
|
||||
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
|
||||
*
|
||||
@ -56,6 +116,24 @@ public final class Routines {
|
||||
return f.asField();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
@ -8,7 +8,7 @@ package org.jooq.util.postgres.pg_catalog;
|
||||
*
|
||||
* 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.4.0"},
|
||||
comments = "This class is generated by jOOQ")
|
||||
public final class Tables {
|
||||
|
||||
|
||||
@ -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.4.0"},
|
||||
comments = "This class is generated by jOOQ")
|
||||
public class Count1 extends org.jooq.impl.AbstractRoutine<java.lang.Long> {
|
||||
|
||||
private static final long serialVersionUID = 1018949472;
|
||||
|
||||
|
||||
/**
|
||||
* 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.impl.SQLDataType.OTHER);
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
@ -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.4.0"},
|
||||
comments = "This class is generated by jOOQ")
|
||||
public class Count2 extends org.jooq.impl.AbstractRoutine<java.lang.Long> {
|
||||
|
||||
private static final long serialVersionUID = -101223220;
|
||||
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
@ -6,11 +6,11 @@ package org.jooq.util.postgres.pg_catalog.routines;
|
||||
/**
|
||||
* 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.4.0"},
|
||||
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 = 428047358;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -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.4.0"},
|
||||
comments = "This class is generated by jOOQ")
|
||||
public class PgCursor extends org.jooq.impl.AbstractRoutine<java.lang.Void> {
|
||||
|
||||
private static final long serialVersionUID = 1046377097;
|
||||
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
@ -6,28 +6,23 @@ package org.jooq.util.postgres.pg_catalog.tables;
|
||||
/**
|
||||
* 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.4.0"},
|
||||
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 = 1961406872;
|
||||
|
||||
/**
|
||||
* The singleton instance of pg_catalog.pg_attribute
|
||||
*/
|
||||
public static final org.jooq.util.postgres.pg_catalog.tables.PgAttribute PG_ATTRIBUTE = new org.jooq.util.postgres.pg_catalog.tables.PgAttribute();
|
||||
|
||||
/**
|
||||
* 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 class PgAttribute extends org.jooq.impl.TableImpl<org.jooq.Record> {
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@ -6,28 +6,23 @@ package org.jooq.util.postgres.pg_catalog.tables;
|
||||
/**
|
||||
* 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.4.0"},
|
||||
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 = -2038078835;
|
||||
|
||||
/**
|
||||
* The singleton instance of pg_catalog.pg_class
|
||||
*/
|
||||
public static final org.jooq.util.postgres.pg_catalog.tables.PgClass PG_CLASS = new org.jooq.util.postgres.pg_catalog.tables.PgClass();
|
||||
|
||||
/**
|
||||
* 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 class PgClass extends org.jooq.impl.TableImpl<org.jooq.Record> {
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@ -6,28 +6,23 @@ package org.jooq.util.postgres.pg_catalog.tables;
|
||||
/**
|
||||
* 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.4.0"},
|
||||
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 = -741676635;
|
||||
|
||||
/**
|
||||
* The singleton instance of pg_catalog.pg_enum
|
||||
*/
|
||||
public static final org.jooq.util.postgres.pg_catalog.tables.PgEnum PG_ENUM = new org.jooq.util.postgres.pg_catalog.tables.PgEnum();
|
||||
|
||||
/**
|
||||
* 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 class PgEnum extends org.jooq.impl.TableImpl<org.jooq.Record> {
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@ -6,28 +6,23 @@ package org.jooq.util.postgres.pg_catalog.tables;
|
||||
/**
|
||||
* 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.4.0"},
|
||||
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 = 2129977430;
|
||||
|
||||
/**
|
||||
* The singleton instance of pg_catalog.pg_namespace
|
||||
*/
|
||||
public static final org.jooq.util.postgres.pg_catalog.tables.PgNamespace PG_NAMESPACE = new org.jooq.util.postgres.pg_catalog.tables.PgNamespace();
|
||||
|
||||
/**
|
||||
* 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 class PgNamespace extends org.jooq.impl.TableImpl<org.jooq.Record> {
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@ -6,28 +6,23 @@ package org.jooq.util.postgres.pg_catalog.tables;
|
||||
/**
|
||||
* 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.4.0"},
|
||||
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 = 1760477283;
|
||||
|
||||
/**
|
||||
* The singleton instance of pg_catalog.pg_proc
|
||||
*/
|
||||
public static final org.jooq.util.postgres.pg_catalog.tables.PgProc PG_PROC = new org.jooq.util.postgres.pg_catalog.tables.PgProc();
|
||||
|
||||
/**
|
||||
* 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 class PgProc extends org.jooq.impl.TableImpl<org.jooq.Record> {
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@ -6,28 +6,23 @@ package org.jooq.util.postgres.pg_catalog.tables;
|
||||
/**
|
||||
* 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.4.0"},
|
||||
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 = -1252060599;
|
||||
|
||||
/**
|
||||
* The singleton instance of pg_catalog.pg_type
|
||||
*/
|
||||
public static final org.jooq.util.postgres.pg_catalog.tables.PgType PG_TYPE = new org.jooq.util.postgres.pg_catalog.tables.PgType();
|
||||
|
||||
/**
|
||||
* 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 class PgType extends org.jooq.impl.TableImpl<org.jooq.Record> {
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<property name="dir.workspace" value="${basedir}/.." />
|
||||
<property name="dir.target" value="${basedir}/target" />
|
||||
<property name="dir.release" value="${basedir}/release" />
|
||||
<property name="version" value="2.3.0"/>
|
||||
<property name="version" value="2.3.1"/>
|
||||
|
||||
<!-- Run a full mvn clean package install deploy first before this -->
|
||||
<target name="release" description="Release a new version">
|
||||
|
||||
@ -10,6 +10,26 @@ http://www.jooq.org/notes.php
|
||||
For a text version, see
|
||||
http://www.jooq.org/inc/RELEASENOTES.txt
|
||||
|
||||
Version 2.3.1 - May 11, 2012
|
||||
=================================================================
|
||||
This is an important patch release fixing some regressions in the
|
||||
code generator for the Postgres dialect. With 2.3.0, it was no
|
||||
longer possible to generate schemata of which the database user
|
||||
was not the owner.
|
||||
|
||||
Bug fixes
|
||||
---------
|
||||
#1334 - Fix inaccurate simulation of TRUNC(number, decimals) for
|
||||
Derby
|
||||
#1403 - Documentation bug: ctx.statement() can be replaced in
|
||||
executeStart(). This is not documented
|
||||
#1406 - Compilation errors in generated source code when Postgres
|
||||
stored procedure parameter is called "NAME"
|
||||
#1407 - Compilation errors in generated source code when Postgres
|
||||
data-type is "any" (with quotes!)
|
||||
#1409 - Postgres code generation broken when not connecting with
|
||||
the owner of a schema
|
||||
|
||||
Version 2.3.0 - May 6, 2012
|
||||
=================================================================
|
||||
|
||||
|
||||
@ -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,pg_cursor
|
||||
generator.database.excludes=
|
||||
generator.generate.deprecated=false
|
||||
generator.generate.instance-fields=true
|
||||
|
||||
@ -603,6 +603,15 @@ extends BaseTest<A, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, I, IPK, T658, T725
|
||||
Field<Double> f3d = floor(-2.0);
|
||||
Field<Double> f4d = ceil(-2.0);
|
||||
|
||||
Field<Float> f1e = round(0.0f);
|
||||
Field<Float> f2e = round(0.0f, 2);
|
||||
Field<Float> f3e = floor(0.0f);
|
||||
Field<Float> f4e = ceil(0.0f);
|
||||
Field<Float> f1f = round(0.0f);
|
||||
Field<Float> f2f = round(0.0f, 2);
|
||||
Field<Float> f3f = floor(0.0f);
|
||||
Field<Float> f4f = ceil(0.0f);
|
||||
|
||||
// Some arbitrary checks on having multiple select clauses
|
||||
Record record =
|
||||
create().select(f1a)
|
||||
@ -611,7 +620,10 @@ extends BaseTest<A, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, I, IPK, T658, T725
|
||||
.select(f5a, f6a, f7a)
|
||||
.select(f1b, f2b, f3b, f4b, f6b, f6b, f7b)
|
||||
.select(f1c, f2c, f3c, f4c)
|
||||
.select(f1d, f2d, f3d, f4d).fetchOne();
|
||||
.select(f1d, f2d, f3d, f4d)
|
||||
.select(f1e, f2e, f3e, f4e)
|
||||
.select(f1f, f2f, f3f, f4f)
|
||||
.fetchOne();
|
||||
|
||||
assertNotNull(record);
|
||||
assertEquals("1.0", record.getValueAsString(f1a));
|
||||
@ -640,6 +652,16 @@ extends BaseTest<A, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, I, IPK, T658, T725
|
||||
assertEquals("-2.0", record.getValueAsString(f3d));
|
||||
assertEquals("-2.0", record.getValueAsString(f4d));
|
||||
|
||||
assertEquals("0.0", record.getValueAsString(f1e));
|
||||
assertEquals("0.0", record.getValueAsString(f2e));
|
||||
assertEquals("0.0", record.getValueAsString(f3e));
|
||||
assertEquals("0.0", record.getValueAsString(f4e));
|
||||
|
||||
assertEquals("0.0", record.getValueAsString(f1f));
|
||||
assertEquals("0.0", record.getValueAsString(f2f));
|
||||
assertEquals("0.0", record.getValueAsString(f3f));
|
||||
assertEquals("0.0", record.getValueAsString(f4f));
|
||||
|
||||
// Greatest and least
|
||||
record = create().select(
|
||||
greatest(1, 2, 3, 4),
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
$root = "";
|
||||
$version = "2.3.0";
|
||||
$version = "2.3.1";
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
|
||||
@ -10,6 +10,26 @@ http://www.jooq.org/notes.php
|
||||
For a text version, see
|
||||
http://www.jooq.org/inc/RELEASENOTES.txt
|
||||
|
||||
Version 2.3.1 - May 11, 2012
|
||||
=================================================================
|
||||
This is an important patch release fixing some regressions in the
|
||||
code generator for the Postgres dialect. With 2.3.0, it was no
|
||||
longer possible to generate schemata of which the database user
|
||||
was not the owner.
|
||||
|
||||
Bug fixes
|
||||
---------
|
||||
#1334 - Fix inaccurate simulation of TRUNC(number, decimals) for
|
||||
Derby
|
||||
#1403 - Documentation bug: ctx.statement() can be replaced in
|
||||
executeStart(). This is not documented
|
||||
#1406 - Compilation errors in generated source code when Postgres
|
||||
stored procedure parameter is called "NAME"
|
||||
#1407 - Compilation errors in generated source code when Postgres
|
||||
data-type is "any" (with quotes!)
|
||||
#1409 - Postgres code generation broken when not connecting with
|
||||
the owner of a schema
|
||||
|
||||
Version 2.3.0 - May 6, 2012
|
||||
=================================================================
|
||||
|
||||
|
||||
@ -10,6 +10,26 @@ http://www.jooq.org/notes.php
|
||||
For a text version, see
|
||||
http://www.jooq.org/inc/RELEASENOTES.txt
|
||||
|
||||
Version 2.3.1 - May 11, 2012
|
||||
=================================================================
|
||||
This is an important patch release fixing some regressions in the
|
||||
code generator for the Postgres dialect. With 2.3.0, it was no
|
||||
longer possible to generate schemata of which the database user
|
||||
was not the owner.
|
||||
|
||||
Bug fixes
|
||||
---------
|
||||
#1334 - Fix inaccurate simulation of TRUNC(number, decimals) for
|
||||
Derby
|
||||
#1403 - Documentation bug: ctx.statement() can be replaced in
|
||||
executeStart(). This is not documented
|
||||
#1406 - Compilation errors in generated source code when Postgres
|
||||
stored procedure parameter is called "NAME"
|
||||
#1407 - Compilation errors in generated source code when Postgres
|
||||
data-type is "any" (with quotes!)
|
||||
#1409 - Postgres code generation broken when not connecting with
|
||||
the owner of a schema
|
||||
|
||||
Version 2.3.0 - May 6, 2012
|
||||
=================================================================
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
<groupId>org.jooq</groupId>
|
||||
<artifactId>jooq</artifactId>
|
||||
<version>2.3.0</version>
|
||||
<version>2.4.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>jOOQ</name>
|
||||
|
||||
@ -45,7 +45,7 @@ public final class Constants {
|
||||
/**
|
||||
* The latest jOOQ version
|
||||
*/
|
||||
public static final String VERSION = "2.3.0";
|
||||
public static final String VERSION = "2.4.0";
|
||||
|
||||
/**
|
||||
* No further instances
|
||||
|
||||
@ -460,6 +460,15 @@ public interface ExecuteListener {
|
||||
* </li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* Overridable attributes in <code>ExecuteContext</code>:
|
||||
* <ul>
|
||||
* <li> {@link ExecuteContext#statement(PreparedStatement)}: The
|
||||
* <code>Statement</code>, <code>PreparedStatement</code>, or
|
||||
* <code>CallableStatement</code> that is about to be executed. You can
|
||||
* modify this statement freely, or wrap {@link ExecuteContext#statement()}
|
||||
* with your enriched statement wrapper</li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* Note that this method is not called when executing queries of type
|
||||
* {@link StatementType#STATIC_STATEMENT}
|
||||
*/
|
||||
@ -497,6 +506,15 @@ public interface ExecuteListener {
|
||||
* </ul>
|
||||
* </li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* Overridable attributes in <code>ExecuteContext</code>:
|
||||
* <ul>
|
||||
* <li> {@link ExecuteContext#statement(PreparedStatement)}: The
|
||||
* <code>Statement</code>, <code>PreparedStatement</code>, or
|
||||
* <code>CallableStatement</code> that is about to be executed. You can
|
||||
* modify this statement freely, or wrap {@link ExecuteContext#statement()}
|
||||
* with your enriched statement wrapper</li>
|
||||
* </ul>
|
||||
*/
|
||||
void executeStart(ExecuteContext ctx);
|
||||
|
||||
|
||||
@ -688,7 +688,7 @@ public interface FactoryOperations extends Configuration {
|
||||
* is omitted for future extensibility of this command.
|
||||
*/
|
||||
@Support
|
||||
<R extends TableRecord<R>> Truncate<R> truncate(Table<R> table);
|
||||
<R extends Record> Truncate<R> truncate(Table<R> table);
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// XXX Other queries for identities and sequences
|
||||
|
||||
@ -40,6 +40,6 @@ package org.jooq;
|
||||
*
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
public interface Truncate<R extends TableRecord<R>> extends Query {
|
||||
public interface Truncate<R extends Record> extends Query {
|
||||
|
||||
}
|
||||
|
||||
@ -1489,7 +1489,7 @@ public class Factory implements FactoryOperations {
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public final <R extends TableRecord<R>> Truncate<R> truncate(Table<R> table) {
|
||||
public final <R extends Record> Truncate<R> truncate(Table<R> table) {
|
||||
return new TruncateImpl<R>(this, table);
|
||||
}
|
||||
|
||||
|
||||
@ -344,7 +344,7 @@ public final class FactoryProxy implements FactoryOperations {
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <R extends TableRecord<R>> Truncate<R> truncate(Table<R> table) {
|
||||
public final <R extends Record> Truncate<R> truncate(Table<R> table) {
|
||||
return getDelegate().truncate(table);
|
||||
}
|
||||
|
||||
|
||||
@ -35,12 +35,15 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static java.math.BigDecimal.TEN;
|
||||
import static org.jooq.impl.Factory.field;
|
||||
import static org.jooq.impl.Factory.inline;
|
||||
import static org.jooq.impl.Factory.one;
|
||||
import static org.jooq.impl.Factory.zero;
|
||||
import static org.jooq.impl.Util.extractVal;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.MathContext;
|
||||
|
||||
import org.jooq.Configuration;
|
||||
import org.jooq.Field;
|
||||
@ -82,10 +85,18 @@ class Trunc<T> extends AbstractFunction<T> {
|
||||
private final Field<T> getNumericFunction(Configuration configuration) {
|
||||
switch (configuration.getDialect()) {
|
||||
case ASE:
|
||||
|
||||
// This calculation is inaccurate for Derby
|
||||
case DERBY: {
|
||||
Field<BigDecimal> power = Factory.power(inline(new BigDecimal("10.0")), decimals);
|
||||
Field<BigDecimal> power;
|
||||
|
||||
// [#1334] if possible, calculate the power in Java to prevent
|
||||
// inaccurate arithmetics in the Derby database
|
||||
Integer decimalsVal = extractVal(decimals);
|
||||
if (decimalsVal != null) {
|
||||
power = inline(TEN.pow(decimalsVal, MathContext.DECIMAL128));
|
||||
}
|
||||
else {
|
||||
power = Factory.power(inline(TEN), decimals);
|
||||
}
|
||||
|
||||
return Factory.decode()
|
||||
.when(field.sign().greaterOrEqual(zero()),
|
||||
|
||||
@ -40,16 +40,16 @@ import java.util.List;
|
||||
import org.jooq.Attachable;
|
||||
import org.jooq.BindContext;
|
||||
import org.jooq.Configuration;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.RenderContext;
|
||||
import org.jooq.SQLDialect;
|
||||
import org.jooq.Table;
|
||||
import org.jooq.TableRecord;
|
||||
import org.jooq.Truncate;
|
||||
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
*/
|
||||
class TruncateImpl<R extends TableRecord<R>> extends AbstractQuery implements Truncate<R> {
|
||||
class TruncateImpl<R extends Record> extends AbstractQuery implements Truncate<R> {
|
||||
|
||||
/**
|
||||
* Generated UID
|
||||
|
||||
@ -1028,4 +1028,23 @@ final class Util {
|
||||
return field.cast(String.class);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to check whether a field is a {@link Param}
|
||||
*/
|
||||
static final boolean isVal(Field<?> field) {
|
||||
return field instanceof Param;
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to extract a value from a field
|
||||
*/
|
||||
static final <T> T extractVal(Field<T> field) {
|
||||
if (isVal(field)) {
|
||||
return ((Param<T>) field).getValue();
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -136,6 +136,7 @@ public class PostgresDataType<T> extends AbstractDataType<T> {
|
||||
public static final PostgresDataType<Timestamp> TIMESTAMPWITHTIMEZONE = new PostgresDataType<Timestamp>(SQLDataType.TIMESTAMP, "timestamp with time zone");
|
||||
public static final PostgresDataType<Timestamp> TIMESTAMPTZ = new PostgresDataType<Timestamp>(SQLDataType.TIMESTAMP, "timestamptz");
|
||||
public static final PostgresDataType<Result<Record>> REFCURSOR = new PostgresDataType<Result<Record>>(SQLDataType.RESULT, "refcursor");
|
||||
public static final PostgresDataType<Object> ANY = new PostgresDataType<Object>(SQLDataType.OTHER, "any");
|
||||
|
||||
// Meta-table types
|
||||
public static final PostgresDataType<Long> OID = new PostgresDataType<Long>(SQLDataType.BIGINT, "oid");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user