Commit Graph

7429 Commits

Author SHA1 Message Date
Knut Wannheden
50ac9e746c [#1699] Support UNIQUE constraint
Add DSL#unique(Select) which represents the standard SQL "UNIQUE"
constraint. Since no of the supported dialects natively support UNIQUE,
the constraint is always emulated as a NOT EXISTS predicate (and NOT
UNIQUE is emulated as a corresponding EXISTS predicate). See the
following example:

  NOT EXISTS (
    SELECT NULL
    FROM (SELECT 1 a, 2 b UNION ALL SELECT 1 a, 2 b) t
    WHERE (a, b) IS NOT NULL
    GROUP BY a, b
    HAVING count(*) > 1
  )
2019-04-24 11:51:58 +02:00
Knut Wannheden
323b8cc36b Added Knut to ABOUT.txt 2019-04-24 11:51:29 +02:00
lukaseder
affcc1c1d6 Merge branch 'master' of https://github.com/jOOQ/jOOQ 2019-04-24 10:34:58 +02:00
lukaseder
fc8f74ed87 [#7851] DSL.coerce() should use argument field's qualified name 2019-04-24 10:34:54 +02:00
Lukas Eder
a3f14da0e8
Merge pull request #7851 from dhs3000/patch-1
In Coerce use the qualified name so that fields can be compared again
2019-04-23 16:00:29 +02:00
lukaseder
65ce24294c [#8561] Wrong cast generated for Informix and others when casting a LocalDateTime value 2019-04-23 15:34:12 +02:00
lukaseder
60d856075e [#8560] Add support for calling stored functions with defaulted parameters from SQL in Oracle 2019-04-23 14:31:11 +02:00
Knut Wannheden
726897cf1d [#8513] Fix potential NPE source in getConfiguredForcedType()
Fixes a potential NPE source in
AbstractDatabase#getConfiguredForcedType().
2019-04-23 14:15:32 +02:00
Knut Wannheden
8f616025c2 [#8511] Updated DefaultRenderContext#SQLITE_KEYWORDS to SQLite 3.28
Updated DefaultRenderContext#SQLITE_KEYWORDS to include all keywords in
SQLite 3.28. See https://www.sqlite.org/lang_keywords.html.
2019-04-23 14:06:25 +02:00
lukaseder
d67d04b19a [#8557] StackOverflowError when using same query instance on both sides of a set operation
In jOOQ 3.x, the DSL API is mostly mutable. For set operations, this means that a query x cannot appear on both sides of the set operation, e.g. x.union(x) is not possible.
2019-04-23 10:31:07 +02:00
lukaseder
9323e819c3 [#8548] Missing H2 support on WindowExcludeStep.excludeNoOthers() 2019-04-23 09:39:11 +02:00
lukaseder
fa9422521f [#8548] Add support for SQLite window function extensions from version 3.28 2019-04-18 18:01:12 +02:00
lukaseder
6860388843 [#8552] Add SQLDialect.supports(Collection<SQLDialect>) 2019-04-18 17:46:08 +02:00
lukaseder
c7beac5ae3 [#8547] Add SQLDialect.SQLITE_3_28 and SQLDialect.SQLITE_3_25 2019-04-18 16:26:06 +02:00
lukaseder
a7215a91ba [#8551] Support old SQLDialects only in commercial distributions 2019-04-18 16:11:37 +02:00
lukaseder
1116644cde [#8550] Improve formatting of generated table-level JPA annotations 2019-04-18 11:23:35 +02:00
lukaseder
65d779065f [#8536] Missing constraint name in generated @UniqueConstraint annotation 2019-04-18 10:56:38 +02:00
lukaseder
b7e6923f34 [#8502] Missing annotation 2019-04-18 10:56:29 +02:00
Knut Wannheden
e24d186330 [#8433] INSERT ... ON CONFLICT clause for SQLite
As of version 3.24.0 SQLite natively supports INSERT's ON CONFLICT
clause, which can thus also be used by jOOQ.

Note: SQLite doesn't support combining DEFAULT VALUES with ON CONFLICT.
And since SQLite does not support the DEFAULT keyword in INSERT the
DEFAULT VALUES clause cannot be emulated.
2019-04-18 10:48:37 +02:00
Knut Wannheden
861c4422c7 Regenerate JAXB code
Specify <noFileHeader> option to maven-jaxb2-plugin and also normalize
line terminators to UNIX style.
2019-04-18 10:22:24 +02:00
lukaseder
b65a945c91 [#8539] Add alias DSL.default_() for DSL.defaultValue() 2019-04-17 14:27:43 +02:00
lukaseder
66249dcfb7 [#7545] Fixed regression caused by unnecessary application of Filters 2019-04-17 14:18:09 +02:00
lukaseder
c5903425ee [#8537] Parsing CREATE SEQUENCE always leads to quoted sequence names 2019-04-17 13:38:03 +02:00
lukaseder
348909d9e2 Regenerated example code 2019-04-17 11:27:10 +02:00
lukaseder
97cab67e4a [#8535] Generate @UniqueConstraint annotation instead of @Column(unique = true)
The current distinction is confusing, and if redundant uniqueness information is present, then Hibernate ignores the @UniqueConstraint name. Hence, we will only generate the @UniqueConstraint annotation
2019-04-17 11:26:59 +02:00
lukaseder
5156f503b4 [#7490] Upgrade jOOQ-meta-extensions dependency to Hibernate 5.4 2019-04-17 09:38:27 +02:00
lukaseder
be6200e1ba [#8522] Added integration test for chained function calls 2019-04-16 16:55:15 +02:00
Knut Wannheden
56fe33475d [#8529] Clean up Javadoc for INSERT ... ON CONFLICT
Improves the DSL Javadoc for INSERT ... ON [ CONFLICT | DUPLICATE KEY ]
2019-04-16 16:22:16 +02:00
lukaseder
97f8700abf [#8531] Wrong Context.subqueryLevel() when emulating derived column lists
If a QueryPart generates a subquery explicitly, then it has to mark it as such.
2019-04-16 16:08:40 +02:00
Knut Wannheden
adcb72fcfb [#7545] Add <includeExpression> and <excludeExpression> to <forcedType>
Add <includeExpression> and <excludeExpression> as well as
<includeTypes> and <excludeTypes> to <forcedType>. The generator will
warn about usage conflicting with the legacy <expression>,
<expressions>, and <types> elements.
2019-04-16 15:34:24 +02:00
Knut Wannheden
840f5a2aed [#8527] Fix MiniJAXB#append() when called using enums
The JAXB generated models also define Java enums, which should thus also
be supported by MiniJAXB#append().
2019-04-16 12:55:45 +02:00
Knut Wannheden
652e2b1a96 [#8515] Fix type hierarchy of InsertOnConflictConditionStep
InsertOnConflictConditionStep now extends InsertReturningStep rather
than InsertFinalStep and is now also the type returned by the methods
declared in InsertOnConflictWhereStep.
2019-04-16 12:49:47 +02:00
Knut Wannheden
14a0f6ddc8 [#3607] [#8522] Support PL/SQL BOOLEAN types in SQL functions 2019-04-16 12:49:37 +02:00
lukaseder
927708b15a [#3607] [#8522] Support PL/SQL BOOLEAN types in SQL functions
[#8522] Emulate the PL/SQL BOOLEAN type in SQL functions in Oracle 12c
[#3607] Allow for emitting common table expression declarations to RenderContext
2019-04-16 12:04:53 +02:00
lukaseder
1673a1b971 [#6234] The encoded newline characters must be decoded 2019-04-13 18:37:54 +02:00
lukaseder
ab3f0ed371 [#8512] JPADatabase may not be able to properly detect AttributeConverter
Some implementation of this database may have already configured a forced type programmatically, so we must not set the list but append it.
2019-04-11 16:54:56 +02:00
lukaseder
381adbc492 [#8512] JPADatabase may not be able to properly detect AttributeConverter 2019-04-11 16:26:07 +02:00
Knut Wannheden
a5d4c00b7a [#6971] Regenerated code from jooq-codegen-3.12.0.xsd 2019-04-10 16:25:51 +02:00
lukaseder
cd057d34d4 [#461] [#473] [#2597] [#8234] Unnecessary casts should no longer be ignored
Historically, SQL casts were ignored if jOOQ's Field<T> type was of the same type T as the cast type. This makes sense for some internals, but not in the public API. When a user wants to cast an expression, this should always produce a SQL cast.
2019-04-10 16:16:20 +02:00
lukaseder
5832e45eaf [#6971] Added missing class 2019-04-10 14:40:37 +02:00
lukaseder
320b7a5b85 [#8505] Modules should reference managed H2 dependency 2019-04-10 14:27:30 +02:00
lukaseder
d3a19273ad [#8504] Remove manual from OSS repository 2019-04-10 14:26:36 +02:00
Knut Wannheden
df2ec439bc [#6971] Add <onError/> to generator's <configuration/>
Using the new <onError/> (which accepts the values FAIL (default), LOG,
and SILENT) the generator's behavior on an encountered exceptions can be
controlled.
2019-04-10 12:20:17 +02:00
lukaseder
929529ec7a [#8503] Make SET clause in ON DUPLICATE KEY UPDATE optional in parser
jOOQ parses a synthetic SET clause which is not supported by MySQL. This clause must be parsed optionally
2019-04-10 12:01:55 +02:00
lukaseder
3f84ccf58f [#8479] Emulate INSERT .. ON DUPLICATE KEY UPDATE .. WHERE on MySQL
MySQL doesn't support the useful WHERE clause on ON DUPLICATE KEY UPDATE like PostgreSQL does on ON CONFLICT. But it can easily be emulated using CASE if users do not rely on the effective update counts.
2019-04-10 11:52:56 +02:00
lukaseder
72eda66bdf [#8434] Support H2 v1.4.198 array syntax
H2 1.4.198 changed array syntax incompatibly to align the syntax with PostgreSQL, HSQLDB, and the SQL standard. The old syntax (which conflicts with row value expression) is no longer really supported.
2019-04-10 11:50:28 +02:00
lukaseder
6d630cd53a [#8434] Support H2 v1.4.198 array syntax
H2 1.4.198 changed array syntax incompatibly to align the syntax with PostgreSQL, HSQLDB, and the SQL standard. The old syntax (which conflicts with row value expression) is no longer really supported.
2019-04-10 11:12:28 +02:00
lukaseder
a55a362fd8 [#8502] Add support for H2 1.4.198 row value expression subquery syntax
H2 breaks backwards compatibility in 1.4.198 and supports row value expressions at the price of desupporting the "old" vendor specific array syntax. This means we can now remove some H2 specific logic and implement standard row value expression syntax also for H2
2019-04-09 17:49:26 +02:00
lukaseder
19b19411c0 [#8493] Support JSR 310 types as <name/> in <forcedType/> data type rewriting feature
Some SQLDataTypes are "synthetic" aliases of other types, and as such could not yet be used as forcedType names because they were not recognised, despite what the manual says.
2019-04-09 17:08:10 +02:00
Knut Wannheden
ab3ea42784 Release 3.11.11 2019-04-09 16:38:32 +02:00