Skip to content

Commit

Permalink
Version 3.5.1 - January 03, 2015
Browse files Browse the repository at this point in the history
================================================================================

This is a patch release with some useful fixes for the 3.5 branch

Bug fixes
---------
#3378 - Error when fully qualifying PostgreSQL table-valued functions in
SELECT clauses
#3803 - CREATE TABLE statement does not generate NOT NULL constraint
#3811 - Potential NullPointerException in Cursor.fetchOne(RecordMapper)
and other methods
#3817 - When used with set operations, ORDER BY must not contain any
qualified fields
#3819 - Add Constants.XSD_META and Constants.NS_META to describe the new
jooq-meta-x.x.xsd
#3822 - Invalid SQL for Postgres created with values(Row1...)
#3824 - PostgreSQL dateAdd() erroneously returns a TIMESTAMP value
#3831 - <dateAsTimestamp/> deprecation warning is displayed even if the
flag is not active
#3833 - org.jooq.CreateTableAsStep.column(Field<T> field, DataType<T>
type) SQLite
#3835 - SQLite's CREATE VIEW statement doesn't allow to rename columns
#3838 - Bad @Support annotations on ALTER TABLE statements, which are
not supported by SQLite
#3855 - Oracle REAL and FLOAT types cause code generator to produce
BigInteger instead of Double types
#3863 - CSV-Export with delimiter only does not work properly
#3880 - Cannot access private JavaGenerator.newJavaWriter() method
#3888 - Data type conversion fails when using a Binding<byte[],
Serializable> and passing a byte[] as user input
#3895 The free trial version no longer works after Jan 01, 2015
  • Loading branch information
lukaseder committed Jan 3, 2015
1 parent c0cb495 commit d24ce2b
Show file tree
Hide file tree
Showing 35 changed files with 207 additions and 94 deletions.
2 changes: 1 addition & 1 deletion jOOQ-codegen-maven/pom.xml
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.jooq</groupId>
<artifactId>jooq-parent</artifactId>
<version>3.5.0</version>
<version>3.5.1</version>
</parent>

<groupId>org.jooq</groupId>
Expand Down
2 changes: 1 addition & 1 deletion jOOQ-codegen/pom.xml
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.jooq</groupId>
<artifactId>jooq-parent</artifactId>
<version>3.5.0</version>
<version>3.5.1</version>
</parent>

<groupId>org.jooq</groupId>
Expand Down
Expand Up @@ -341,7 +341,7 @@ else if (schema.getOutputSchema() == null) {

if (d.getEnumTypes().size() > 0)
log.warn("DEPRECATED", "The configuration property /configuration/generator/database/enumTypes is experimental and deprecated and will be removed in the future.");
if (d.isDateAsTimestamp() != null)
if (Boolean.TRUE.equals(d.isDateAsTimestamp()))
log.warn("DEPRECATED", "The configuration property /configuration/generator/database/dateAsTimestamp is deprecated as it is superseded by custom bindings and converters. It will thus be removed in the future.");

if (d.isDateAsTimestamp() != null)
Expand Down
9 changes: 7 additions & 2 deletions jOOQ-codegen/src/main/java/org/jooq/util/JavaGenerator.java
Expand Up @@ -2104,7 +2104,11 @@ protected void generateTable(SchemaDefinition schema, TableDefinition table) {

out.println();
out.tab(1).println("private %s(%s alias, %s<%s> aliased) {", className, String.class, Table.class, recordType);
out.tab(2).println("this(alias, aliased, null);");
if (table.isTableValuedFunction())
out.tab(2).println("this(alias, aliased, new %s[%s]);", Field.class, table.getParameters().size());
else
out.tab(2).println("this(alias, aliased, null);");

out.tab(1).println("}");

out.println();
Expand Down Expand Up @@ -3380,7 +3384,8 @@ private static final <T> List<T> list(T... objects) {
return result;
}

private final JavaWriter newJavaWriter(File file) {
// [#3880] Users may need to call this method
protected final JavaWriter newJavaWriter(File file) {
files.add(file);
return new JavaWriter(file);
}
Expand Down
2 changes: 1 addition & 1 deletion jOOQ-examples/jOOQ-flyway-example/pom.xml
Expand Up @@ -19,7 +19,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<org.springframework.version>3.2.6.RELEASE</org.springframework.version>
<org.jooq.version>3.5.0</org.jooq.version>
<org.jooq.version>3.5.1</org.jooq.version>

<db.url>jdbc:h2:~/flyway-test</db.url>
<db.username>sa</db.username>
Expand Down
4 changes: 2 additions & 2 deletions jOOQ-examples/jOOQ-jax-rs-example/pom.xml
Expand Up @@ -35,7 +35,7 @@
<plugin>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
<version>3.5.0</version>
<version>3.5.1</version>

<executions>
<execution>
Expand Down Expand Up @@ -108,7 +108,7 @@
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq</artifactId>
<version>3.5.0</version>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
Expand Down
2 changes: 1 addition & 1 deletion jOOQ-examples/jOOQ-nashorn-example/pom.xml
Expand Up @@ -19,7 +19,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<org.springframework.version>3.2.6.RELEASE</org.springframework.version>
<org.jooq.version>3.5.0</org.jooq.version>
<org.jooq.version>3.5.1</org.jooq.version>
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion jOOQ-examples/jOOQ-oracle-example/pom.xml
Expand Up @@ -18,7 +18,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<org.jooq.version>3.5.0</org.jooq.version>
<org.jooq.version>3.5.1</org.jooq.version>
<db.oracle.version>11</db.oracle.version>
</properties>

Expand Down
2 changes: 1 addition & 1 deletion jOOQ-examples/jOOQ-spring-example/pom.xml
Expand Up @@ -19,7 +19,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<org.springframework.version>4.1.2.RELEASE</org.springframework.version>
<org.jooq.version>3.5.0</org.jooq.version>
<org.jooq.version>3.5.1</org.jooq.version>
<java.version>1.8</java.version>
</properties>

Expand Down
2 changes: 1 addition & 1 deletion jOOQ-examples/jOOQ-spring-guice-example/pom.xml
Expand Up @@ -19,7 +19,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<org.springframework.version>4.1.2.RELEASE</org.springframework.version>
<org.jooq.version>3.5.0</org.jooq.version>
<org.jooq.version>3.5.1</org.jooq.version>
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion jOOQ-examples/jOOQ-vertabelo-example/pom.xml
Expand Up @@ -19,7 +19,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<org.springframework.version>3.2.6.RELEASE</org.springframework.version>
<org.jooq.version>3.5.0</org.jooq.version>
<org.jooq.version>3.5.1</org.jooq.version>
</properties>

<dependencies>
Expand Down
2 changes: 1 addition & 1 deletion jOOQ-meta/pom.xml
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.jooq</groupId>
<artifactId>jooq-parent</artifactId>
<version>3.5.0</version>
<version>3.5.1</version>
</parent>

<groupId>org.jooq</groupId>
Expand Down
2 changes: 1 addition & 1 deletion jOOQ-release/build.xml
Expand Up @@ -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="3.5.0"/>
<property name="version" value="3.5.1"/>

<!-- Run a full mvn clean package install deploy first before this -->
<target name="copy-lib-javadoc">
Expand Down
16 changes: 16 additions & 0 deletions jOOQ-release/release/template/RELEASE-NOTES.txt.regex
@@ -0,0 +1,16 @@
Sophisticated GitHub issue export script

- "Export" from GitHub via copy paste
- Apply regexes:
o search ^\s*\d+$\n
replace
o search ^#\d+.*?$\n
replace
o search ^\s*(.*?) - Merge \[(.*?)\].*?$
replace $2 - $1
-------------------------------------

27 changes: 26 additions & 1 deletion jOOQ-release/release/template/RELEASENOTES.txt
Expand Up @@ -10,7 +10,32 @@ http://www.jooq.org/notes.php
For a text version, see
http://www.jooq.org/inc/RELEASENOTES.txt

Version 3.5.0 - September 19, 2014
Version 3.5.1 - January 03, 2015
================================================================================

This is a patch release with some useful fixes for the 3.5 branch

Bug fixes
---------
#3378 - Error when fully qualifying PostgreSQL table-valued functions in SELECT clauses
#3803 - CREATE TABLE statement does not generate NOT NULL constraint
#3811 - Potential NullPointerException in Cursor.fetchOne(RecordMapper) and other methods
#3817 - When used with set operations, ORDER BY must not contain any qualified fields
#3819 - Add Constants.XSD_META and Constants.NS_META to describe the new jooq-meta-x.x.xsd
#3822 - Invalid SQL for Postgres created with values(Row1...)
#3824 - PostgreSQL dateAdd() erroneously returns a TIMESTAMP value
#3831 - <dateAsTimestamp/> deprecation warning is displayed even if the flag is not active
#3833 - org.jooq.CreateTableAsStep.column(Field<T> field, DataType<T> type) SQLite
#3835 - SQLite's CREATE VIEW statement doesn't allow to rename columns
#3838 - Bad @Support annotations on ALTER TABLE statements, which are not supported by SQLite
#3855 - Oracle REAL and FLOAT types cause code generator to produce BigInteger instead of Double types
#3863 - CSV-Export with delimiter only does not work properly
#3880 - Cannot access private JavaGenerator.newJavaWriter() method
#3888 - Data type conversion fails when using a Binding<byte[], Serializable> and passing a byte[] as user input
#3895 The free trial version no longer works after Jan 01, 2015


Version 3.5.0 - November 21, 2014
================================================================================

The new Binding SPI
Expand Down
2 changes: 1 addition & 1 deletion jOOQ-release/release/template/maven-install.bat
@@ -1,5 +1,5 @@
@echo off
set VERSION=3.5.0
set VERSION=3.5.1

if exist jOOQ-javadoc\jooq-%VERSION%-javadoc.jar (
set JAVADOC_JOOQ=-Djavadoc=jOOQ-javadoc\jooq-%VERSION%-javadoc.jar
Expand Down
2 changes: 1 addition & 1 deletion jOOQ-release/release/template/maven-install.sh
@@ -1,5 +1,5 @@
#!/bin/sh
VERSION=3.5.0
VERSION=3.5.1

if [ -f jOOQ-javadoc/jooq-$VERSION-javadoc.jar ]; then
JAVADOC_JOOQ=-Djavadoc=jOOQ-javadoc/jooq-$VERSION-javadoc.jar
Expand Down
4 changes: 2 additions & 2 deletions jOOQ-scala/pom.xml
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.jooq</groupId>
<artifactId>jooq-parent</artifactId>
<version>3.5.0</version>
<version>3.5.1</version>
</parent>

<groupId>org.jooq</groupId>
Expand Down Expand Up @@ -68,7 +68,7 @@
<plugin>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
<version>3.5.0</version>
<version>3.5.1</version>
<executions>
<execution>
<id>exec1</id>
Expand Down
2 changes: 1 addition & 1 deletion jOOQ/pom.xml
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.jooq</groupId>
<artifactId>jooq-parent</artifactId>
<version>3.5.0</version>
<version>3.5.1</version>
</parent>

<groupId>org.jooq</groupId>
Expand Down
25 changes: 21 additions & 4 deletions jOOQ/src/main/java/org/jooq/AlterTableStep.java
Expand Up @@ -40,6 +40,23 @@
*/
package org.jooq;

// ...
// ...
import static org.jooq.SQLDialect.CUBRID;
// ...
import static org.jooq.SQLDialect.DERBY;
import static org.jooq.SQLDialect.FIREBIRD;
import static org.jooq.SQLDialect.H2;
import static org.jooq.SQLDialect.HSQLDB;
// ...
// ...
import static org.jooq.SQLDialect.MARIADB;
import static org.jooq.SQLDialect.MYSQL;
// ...
import static org.jooq.SQLDialect.POSTGRES;
// ...
// ...


/**
* The step in the <code>ALTER TABLE</code> where the action can be decided.
Expand All @@ -52,14 +69,14 @@ public interface AlterTableStep {
* Add an <code>ALTER COLUMN</code> clause to the <code>ALTER TABLE</code>
* statement.
*/
@Support
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
<T> AlterTableAlterStep<T> alter(Field<T> field);

/**
* Add an <code>ALTER COLUMN</code> clause to the <code>ALTER TABLE</code>
* statement.
*/
@Support
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
AlterTableAlterStep<Object> alter(String field);

/**
Expand All @@ -80,13 +97,13 @@ public interface AlterTableStep {
* Add an <code>DROP COLUMN</code> clause to the <code>ALTER TABLE</code>
* statement.
*/
@Support
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
AlterTableDropStep drop(Field<?> field);

/**
* Add an <code>DROP COLUMN</code> clause to the <code>ALTER TABLE</code>
* statement.
*/
@Support
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
AlterTableDropStep drop(String field);
}
14 changes: 12 additions & 2 deletions jOOQ/src/main/java/org/jooq/Constants.java
Expand Up @@ -58,15 +58,15 @@ public final class Constants {
* This is the same as {@link #MINOR_VERSION}, but it may include patch
* version suffixes.
*/
public static final String VERSION = "3.5.0";
public static final String VERSION = "3.5.1";

/**
* The latest jOOQ full version.
* <p>
* This is the same as {@link #VERSION}, but it may include release
* candidate and other suffixes.
*/
public static final String FULL_VERSION = "3.5.0";
public static final String FULL_VERSION = "3.5.1";

/**
* The current jooq-runtime XSD file name.
Expand All @@ -78,6 +78,16 @@ public final class Constants {
*/
public static final String NS_RUNTIME = "http://www.jooq.org/xsd/" + XSD_RUNTIME;

/**
* The current jooq-meta XSD file name.
*/
public static final String XSD_META = "jooq-meta-3.5.0.xsd";

/**
* The current jooq-meta XML namespace.
*/
public static final String NS_META = "http://www.jooq.org/xsd/" + XSD_META;

/**
* The current jooq-codegen XSD file name.
*/
Expand Down
2 changes: 2 additions & 0 deletions jOOQ/src/main/java/org/jooq/RecordMapper.java
Expand Up @@ -51,6 +51,8 @@ public interface RecordMapper<R extends Record, E> {

/**
* A callback method indicating that the next record has been fetched.
*
* @param record The record to be mapped. This is never null.
*/
E map(R record);
}
9 changes: 9 additions & 0 deletions jOOQ/src/main/java/org/jooq/impl/CreateTableImpl.java
Expand Up @@ -148,15 +148,24 @@ public final void accept(Context<?> ctx) {
.formatIndentStart()
.formatNewLine();

boolean qualify = ctx.qualify();
ctx.qualify(false);

for (int i = 0; i < columnFields.size(); i++) {
ctx.visit(columnFields.get(i))
.sql(" ")
.sql(columnTypes.get(i).getCastTypeName(ctx.configuration()));

if (columnTypes.get(i).nullable())
ctx.sql(" ").keyword("null");
else
ctx.sql(" ").keyword("not null");

if (i < columnFields.size() - 1)
ctx.sql(",").formatSeparator();
}

ctx.qualify(qualify);
ctx.formatIndentEnd()
.formatNewLine()
.sql(")")
Expand Down
15 changes: 13 additions & 2 deletions jOOQ/src/main/java/org/jooq/impl/CreateViewImpl.java
Expand Up @@ -43,6 +43,9 @@
import static org.jooq.Clause.CREATE_VIEW;
import static org.jooq.Clause.CREATE_VIEW_AS;
import static org.jooq.Clause.CREATE_VIEW_NAME;
import static org.jooq.SQLDialect.SQLITE;
import static org.jooq.impl.DSL.selectFrom;
import static org.jooq.impl.DSL.table;

import org.jooq.Clause;
import org.jooq.Configuration;
Expand Down Expand Up @@ -97,12 +100,17 @@ public final CreateViewFinalStep as(Select<? extends R> s) {

@Override
public final void accept(Context<?> ctx) {

// [#3835] SQLite doesn't like renaming columns at the view level
boolean rename = fields != null && fields.length > 0;
boolean renameSupported = ctx.family() != SQLITE;

ctx.start(CREATE_VIEW_NAME)
.keyword("create view")
.sql(" ")
.visit(view);

if (fields != null && fields.length > 0) {
if (rename && renameSupported) {
boolean qualify = ctx.qualify();

ctx.sql("(")
Expand All @@ -117,7 +125,10 @@ public final void accept(Context<?> ctx) {
.keyword("as")
.formatSeparator()
.start(CREATE_VIEW_AS)
.visit(select)
.visit(
rename && !renameSupported
? selectFrom(table(select).as("t", Utils.fieldNames(fields)))
: select)
.end(CREATE_VIEW_AS);
}

Expand Down

0 comments on commit d24ce2b

Please sign in to comment.