Commit Graph

7415 Commits

Author SHA1 Message Date
Lukas Eder
a688f1904a Regenerated example code 2019-07-03 15:27:26 +02:00
Lukas Eder
514f2eda6d [jOOQ/jOOQ#5412] Reverted the feature 2019-07-03 15:27:09 +02:00
Knut Wannheden
156386586f [jOOQ/jOOQ#8853] Guard against unexpected method calls
Depending on what local variable types are used in the user's Java code
(and even on which Java compiler is being used!) a call intended for
`DSL#all(Field...)` may end up being compiled to call
`DSL#all(Object...)`.

To guard against such situations the `DSL#all(Object...)` and
`DSL#any(Object...)` methods now check if the argument is actually an
instance of `Field[]`.

Also fixes parser, which was a victim of the problem described above.
2019-07-03 15:11:27 +02:00
Knut Wannheden
af024cde2d [jOOQ/jOOQ#8853] Support ANY LIKE with subqueries
The implementation of jOOQ/jOOQ#8577 was generalized by building on the
already present quantified predicates support in jOOQ. Thus there are
now the new overloads `Field#like(QuantifiedSelect)` and
`Field#notLike(QuantifiedSelect)` which can be used together with any of
the existing `DSL#any()` and `DSL#all()` overloads. In addition there
are also the new overloads `DSL#any(Field...)` and `DSL#all(Field...)`.

On the implementation side the new predicates are either implemented by
AND- or OR-chaining `LIKE` or `NOT LIKE` predicates (as appropriate) or
for the subquery case by using a query like:

```sql
[TRUE|FALSE] = [ANY|ALL] (
  SELECT <field> {NOT} LIKE "PATTERN"
  FROM <subquery> AS "T"("PATTERN")
)
```
2019-07-03 12:51:43 +02:00
Lukas Eder
23b0c94774 [jOOQ/jOOQ#8889] Upgrade scala 2.12 dependency to 2.12.8 2019-07-03 11:15:57 +02:00
Lukas Eder
caa9935385 [jOOQ/jOOQ#8887] Add SQLDataType.DECIMAL_INTEGER(int) as a shortcut for DataType.precision(int) 2019-07-03 10:13:38 +02:00
Lukas Eder
bee81a3933 [jOOQ/jOOQ#8544] ExecuteListener#end() not last lifecycle event when using DSLContext#fetchOne() 2019-07-02 15:53:41 +02:00
Lukas Eder
10735fdb50 [jOOQ/jOOQ#8883] Use noCondition() in fetchXYZ(Table), fetchXYZ(Table, Condition) overloads 2019-07-02 15:16:02 +02:00
Lukas Eder
79070f0f4b [jOOQ/jOOQ#8877] Avoid newly deprecated filterOne() in fetchAny() 2019-07-02 14:58:06 +02:00
Lukas Eder
6209cec91b [jOOQ/jOOQ#8881] Deprecate internal Tools.filterOne() utility
This utility does not go through the ExecuteListener#exception() lifecycle and should thus be avoided. It is difficult to remove completely because of DML RETURNING clauses, which need quite some refactoring for the lifecycle to work correctly.
2019-07-02 14:56:39 +02:00
Lukas Eder
45d22cfbed [jOOQ/jOOQ#8877] fetchSingle() failure does not trigger ExecuteListener#exception() event 2019-07-02 14:19:57 +02:00
Lukas Eder
06b3e0aecd [#8863] Fix for ScalaGenerator 2019-07-02 09:43:07 +02:00
Knut Wannheden
17c3871525 Remove some duplicated static imports for SQLDialect 2019-06-28 16:16:56 +02:00
Lukas Eder
00c67b61d3 Sync with commercial repository 2019-06-28 15:21:15 +02:00
Lukas Eder
74f3263653 [jOOQ/jOOQ#8863] Use imported class name in Tables.java to dereference singleton table instance 2019-06-28 15:21:08 +02:00
Lukas Eder
bfa5568764 Sync with commercial distribution 2019-06-28 10:30:19 +02:00
Lukas Eder
0a10df6c3c [jOOQ/jOOQ#8867] Add SQLDialect.supported() 2019-06-28 10:27:23 +02:00
Lukas Eder
d9d491e0aa [jOOQ/jOOQ#2059] Add MariaDB support 2019-06-28 10:26:31 +02:00
Lukas Eder
e65b67a7fe [jOOQ/jOOQ#6745] DDL statements on MySQL create CHAR column instead of
VARCHAR column on unknown lengths
2019-06-27 16:03:43 +02:00
Lukas Eder
d087e4a4f6 Sync with commercial distribution 2019-06-26 16:45:39 +02:00
Lukas Eder
e53dc69b0b Some formatting 2019-06-26 16:21:32 +02:00
Knut Wannheden
3dbcccb65a [jOOQ/jOOQ#8808] Only qualify sequence class references when required
The `Sequences` class will now only have fully qualified references to
the sequence classes when there is a name conflict between the schema
and any of its sequences.
2019-06-26 15:57:20 +02:00
Lukas Eder
1a3d5d0252 [jOOQ/jOOQ-pro#103] Remove dependency between jOOQ-tools and jOOQ 2019-06-26 15:32:25 +02:00
Knut Wannheden
1733cd5eaa [jOOQ/jOOQ#8808] Generate qualified references into Sequences class
The references to the static sequence fields in the generated
`Sequences` class should be fully qualified in order to avoid potential
conflicts between schema and sequence names.
2019-06-26 15:26:46 +02:00
Knut Wannheden
517ad869b6 [jOOQ/jOOQ#8859] Check for sequences in generateSchemaIfEmpty()
The `JavaGenerator` should also generate Java code for schemas which
only contain sequences. This was missing in `generateSchemaIfEmpty()`.
2019-06-26 15:06:45 +02:00
Knut Wannheden
501dc030e5 [jOOQ/jOOQ#8857] Spring Boot example should reference custom jOOQ
version
2019-06-26 12:36:48 +02:00
Knut Wannheden
3eba94c925 [jOOQ/jOOQ#8577] Also support NOT LIKE ANY and LIKE ALL
In addition to `LIKE ANY` and `NOT LIKE ALL` the inverse predicates `NOT
LIKE ANY` and `LIKE ALL` are now also supported.
2019-06-26 12:33:30 +02:00
Lukas Eder
c5a3ef1b52 [jOOQ/jOOQ#8857] Spring Boot example should reference custom jOOQ version 2019-06-26 12:32:31 +02:00
Lukas Eder
297868041e [jOOQ/jOOQ#8852] Support parsing empty IN lists 2019-06-26 11:59:46 +02:00
Lukas Eder
bc1704b637 [jOOQ/jOOQ#8856] Generate empty IN lists in SQL for H2 and SQLite 2019-06-26 11:59:29 +02:00
Lukas Eder
81b82a56b1 [jOOQ/jOOQ#8854] Make Tools.fields() methods generic 2019-06-26 10:55:22 +02:00
Lukas Eder
1fbc546b4a [jOOQ/jOOQ#8577] Add Field#likeAny() and #notLikeAll()
(work by @knutwannheden)
2019-06-26 10:38:14 +02:00
Knut Wannheden
c5c8d1d256 Fixed more Javadoc warnings in jOOQ-codegen and jOOQ-meta 2019-06-26 10:26:28 +02:00
Knut Wannheden
32a4bbfff4 Fix all Javadoc warnings in jOOQ
Mostly replaced `>` with `&gt;` in code examples.
2019-06-26 09:34:52 +02:00
Knut Wannheden
2addcf4b5d [jOOQ/jOOQ#8850] Informix: Support LikeEscapeStep#escape() 2019-06-25 12:10:30 +02:00
Knut Wannheden
b10d07e25c Organize some Java imports 2019-06-25 10:04:30 +02:00
Knut Wannheden
b72961dbfb [jOOQ/jOOQ#8835] Remove POSTGRES support for ALTER SCHEMA IF EXISTS
Postgres does not actually implement the `ALTER SCHEMA ... IF EXISTS`
clause.
2019-06-25 09:23:35 +02:00
Knut Wannheden
be64a88083 [jOOQ/jOOQ#8754] Add a few missing parenthesis pairs
While removing the SQL templating the parentheses went missing in some
of the rendered SQL. Also added parenthesis pairs in a few cases where
it might also have been missing before.
2019-06-25 08:41:46 +02:00
Lukas Eder
27973dbf1b [jOOQ/jOOQ#8754] Minor refactoring of SequenceImpl
This is to prevent unnecessary String.equals() checks for something that can only have 2 possible values.
2019-06-24 13:28:24 +02:00
Lukas Eder
5bfbbe5b61 Regenerated example code 2019-06-24 13:28:12 +02:00
Lukas Eder
55b802ed82 Regenerated example code 2019-06-24 10:14:38 +02:00
Lukas Eder
af7d456f0f Add Spring Boot Example to examples build 2019-06-24 10:14:18 +02:00
Lukas Eder
bc4ed3b629 [jOOQ/jOOQ#8754] Fixed jOOQ OSS edition regression 2019-06-24 09:21:20 +02:00
Knut Wannheden
1018b8b1f4 [jOOQ/jOOQ#8837] Add @Support annotations to Operator enum 2019-06-21 12:46:01 +02:00
Knut Wannheden
758e4d1218 [jOOQ/jOOQ#8754] Eliminate more SQL templating
Removes some SQL templating from CUBRIDDSL, OracleDSL, and PostgresDSL.
2019-06-21 12:02:13 +02:00
Knut Wannheden
e027518dbd [jOOQ/jOOQ#8820] Correct schema reference in NEXTVAL() for Postgres
Postgres NEXTVAL() and CURRVAL() require a string literal as argument.
This commit corrects the quote escaping in this string literal.

Also the syntax for H2 is changed from `nextval('my_schema',
'my_sequence')` to `my_schema.my_sequence.nextval`.
2019-06-21 11:14:31 +02:00
Knut Wannheden
db915f77f7 [jOOQ/jOOQ#8077] Support YearToSecond with Oracle 2019-06-21 10:29:59 +02:00
Knut Wannheden
d2393f865e [jOOQ/jOOQ#8836] Omit CREATE SEQUENCE ... NO CACHE for Postgres
Omitting `NO CACHE` implicitly means that the sequence won't do any
caching.
2019-06-21 10:29:06 +02:00
Knut Wannheden
7e49b8209f [jOOQ/jOOQ#8077] Support YearToSecond with Oracle 2019-06-21 09:19:21 +02:00
Knut Wannheden
96e2e8288a [jOOQ/jOOQ#8832] Correct rendering of CREATE SEQUENCE for Oracle
Oracle's `NO` clauses need to be rendered as e.g. `NOCACHE` rather than
`NO CACHE`.

Additionally the parser should also accept this alternative syntax.
2019-06-21 09:11:44 +02:00