diff --git a/jOOQ-release/release/template/RELEASENOTES.txt b/jOOQ-release/release/template/RELEASENOTES.txt index bfd645808e..5ce65962df 100644 --- a/jOOQ-release/release/template/RELEASENOTES.txt +++ b/jOOQ-release/release/template/RELEASENOTES.txt @@ -10,6 +10,21 @@ http://www.jooq.org/notes For a text version, see http://www.jooq.org/inc/RELEASENOTES.txt +Version 3.8.6 - November 4, 2016 +================================================================================ + +This is a patch release with some useful fixes for the 3.8 branch + +Features and Improvements +------------------------- +#5628 - Added hint for m2e to behave +#5635 - Further improve select() Javadoc for empty argument lists + +Bug Fixes +--------- +#5634 - Regression when reading PostgreSQL bytea[] type + + Version 3.8.5 - October 21, 2016 ================================================================================ diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java index 2eb0185694..91365e1acf 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DSL.java +++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java @@ -83,6 +83,7 @@ import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Time; import java.sql.Timestamp; +import java.time.Instant; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; @@ -12087,6 +12088,164 @@ public class DSL { return new DateOrTime(field, SQLDataType.TIMESTAMP); } + + /** + * Convert a string value to a DATE. + */ + @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) + public static Field localDate(String value) { + return Tools.field(Convert.convert(value, LocalDate.class), LocalDate.class); + } + + /** + * Convert a temporal value to a DATE. + */ + @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) + public static Field localDate(LocalDate value) { + return localDate(Tools.field(value)); + } + + /** + * Convert a temporal value to a DATE. + */ + @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) + public static Field localDate(Field field) { + return new DateOrTime(field, SQLDataType.LOCALDATE); + } + + /** + * Convert a string value to a TIME. + */ + @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) + public static Field localTime(String value) { + return Tools.field(Convert.convert(value, LocalTime.class), LocalTime.class); + } + + /** + * Convert a temporal value to a TIME. + */ + @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) + public static Field localTime(LocalTime value) { + return localTime(Tools.field(value)); + } + + /** + * Convert a temporal value to a TIME. + */ + @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) + public static Field localTime(Field field) { + return new DateOrTime(field, SQLDataType.LOCALTIME); + } + + /** + * Convert a string value to a TIMESTAMP. + */ + @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) + public static Field localDateTime(String value) { + return Tools.field(Convert.convert(value, LocalDateTime.class), LocalDateTime.class); + } + + /** + * Convert a temporal value to a TIMESTAMP. + */ + @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) + public static Field localDateTime(LocalDateTime value) { + return localDateTime(Tools.field(value)); + } + + /** + * Convert a temporal value to a TIMESTAMP. + */ + @Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE }) + public static Field localDateTime(Field field) { + return new DateOrTime(field, SQLDataType.LOCALDATETIME); + } + + /** + * Convert a string value to a TIME WITH TIME ZONE. + *

+ * Depending on whether the database preserves the time zone information + * (e.g. {@link SQLDialect#ORACLE}) or not (e.g. + * {@link SQLDialect#POSTGRES}), the resulting value might be converted to + * UTC. Regardless of this fact, the result should be the same + * {@link Instant} (in UTC) as the input. + */ + @Support({ POSTGRES }) + public static Field offsetTime(String value) { + return Tools.field(Convert.convert(value, OffsetTime.class), OffsetTime.class); + } + + /** + * Convert a temporal value to a TIME WITH TIME ZONE. + *

+ * Depending on whether the database preserves the time zone information + * (e.g. {@link SQLDialect#ORACLE}) or not (e.g. + * {@link SQLDialect#POSTGRES}), the resulting value might be converted to + * UTC. Regardless of this fact, the result should be the same + * {@link Instant} (in UTC) as the input. + */ + @Support({ POSTGRES }) + public static Field offsetTime(OffsetTime value) { + return offsetTime(Tools.field(value)); + } + + /** + * Convert a temporal value to a TIME WITH TIME ZONE. + *

+ * Depending on whether the database preserves the time zone information + * (e.g. {@link SQLDialect#ORACLE}) or not (e.g. + * {@link SQLDialect#POSTGRES}), the resulting value might be converted to + * UTC. Regardless of this fact, the result should be the same + * {@link Instant} (in UTC) as the input. + */ + @Support({ POSTGRES }) + public static Field offsetTime(Field field) { + return new DateOrTime(field, SQLDataType.OFFSETTIME); + } + + /** + * Convert a string value to a TIMESTAMP WITH TIME ZONE. + *

+ * Depending on whether the database preserves the time zone information + * (e.g. {@link SQLDialect#ORACLE}) or not (e.g. + * {@link SQLDialect#POSTGRES}), the resulting value might be converted to + * UTC. Regardless of this fact, the result should be the same + * {@link Instant} (in UTC) as the input. + */ + @Support({ POSTGRES }) + public static Field offsetDateTime(String value) { + return Tools.field(Convert.convert(value, OffsetDateTime.class), OffsetDateTime.class); + } + + /** + * Convert a temporal value to a TIMESTAMP WITH TIME ZONE. + *

+ * Depending on whether the database preserves the time zone information + * (e.g. {@link SQLDialect#ORACLE}) or not (e.g. + * {@link SQLDialect#POSTGRES}), the resulting value might be converted to + * UTC. Regardless of this fact, the result should be the same + * {@link Instant} (in UTC) as the input. + */ + @Support({ POSTGRES }) + public static Field offsetDateTime(OffsetDateTime value) { + return offsetDateTime(Tools.field(value)); + } + + /** + * Convert a temporal value to a TIMESTAMP WITH TIME ZONE. + *

+ * Depending on whether the database preserves the time zone information + * (e.g. {@link SQLDialect#ORACLE}) or not (e.g. + * {@link SQLDialect#POSTGRES}), the resulting value might be converted to + * UTC. Regardless of this fact, the result should be the same + * {@link Instant} (in UTC) as the input. + */ + @Support({ POSTGRES }) + public static Field offsetDateTime(Field field) { + return new DateOrTime(field, SQLDataType.OFFSETDATETIME); + } + + /** * Parse a value to a DATE. * diff --git a/jOOQ/src/main/java/org/jooq/impl/DateOrTime.java b/jOOQ/src/main/java/org/jooq/impl/DateOrTime.java index 25faad2b84..8b762ebb16 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DateOrTime.java +++ b/jOOQ/src/main/java/org/jooq/impl/DateOrTime.java @@ -54,7 +54,7 @@ import org.jooq.QueryPart; /** * @author Lukas Eder */ -final class DateOrTime extends AbstractFunction { +final class DateOrTime extends AbstractFunction { /** * Generated UID