Commit Graph

4474 Commits

Author SHA1 Message Date
Lukas Eder
ab676159fa [jOOQ/jOOQ#8903] Add Support annotation also to Nullability enum 2019-07-04 16:49:18 +02:00
Knut Wannheden
f8a6dfacf1 [jOOQ/jOOQ#8900] Make jOOQ compatible with Java 6
- Mostly surround pieces of code with [java-8] preprocessor tags
- Added ExceptionTools#sneakyThrow() which is used in MiniJAXB
2019-07-04 16:26:21 +02:00
Lukas Eder
0309bffc11 [jOOQ/jOOQ#8903] Add Support annotations to DataType methods 2019-07-04 16:25:21 +02:00
Lukas Eder
35b2c864b9 [jOOQ/jOOQ#8904] Add Support annotations to DSL.name() and DSL.keyword() 2019-07-04 16:18:42 +02:00
Lukas Eder
b7d4a75467 [jOOQ/jOOQ#8041] Add missing support annotation to DSL.characterSet() 2019-07-04 16:13:50 +02:00
Lukas Eder
e4a6bfcfd3 [jOOQ/jOOQ#8902] Add missing Support annotation to DSL.collation 2019-07-04 16:12:05 +02:00
Lukas Eder
0b470c64c1 [jOOQ/jOOQ#8899] [jOOQ/jOOQ#8901] More INSERT RETURNING / Oracle fixes
- [jOOQ/jOOQ#8899] Implement specialised emulation for Oracle single row INSERT .. RETURNING with expressions
- [jOOQ/jOOQ#8901] Cannot use INSERT .. RETURNING in Oracle to fetch back a UDT
2019-07-04 15:46:37 +02:00
Lukas Eder
0e6e5e2b3c [jOOQ/jOOQ#8898] Fix INSERT .. RETURNING for Oracle
INSERT .. RETURNING emulation doesn't work on Oracle when returned columns are aliased
2019-07-04 14:11:48 +02:00
Lukas Eder
d6bf5a8fe1 [jOOQ/jOOQ#8897] Fix INSERT .. RETURNING for Oracle
INSERT .. RETURNING emulation doesn't work on Oracle for single row inserts when returning expressions
2019-07-04 13:52:19 +02:00
Lukas Eder
b20658f262 Reverted '[jOOQ/jOOQ#8077] Support YearToSecond with Oracle'
Change added on 2019-06-21. It leads to a few regressions in the Oracle integration tests
2019-07-04 11:15:22 +02:00
Knut Wannheden
a8a20a1a48 [jOOQ/jOOQ#8853] Use parseEscapeClauseIf() consequently 2019-07-03 15:57:37 +02:00
Knut Wannheden
88ed4df42f [jOOQ/jOOQ#8853] Extracted ParserImpl#parseEscapeClauseIf() method 2019-07-03 15:49:47 +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
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
Knut Wannheden
17c3871525 Remove some duplicated static imports for SQLDialect 2019-06-28 16:16:56 +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
Lukas Eder
1a3d5d0252 [jOOQ/jOOQ-pro#103] Remove dependency between jOOQ-tools and jOOQ 2019-06-26 15:32:25 +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
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
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
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
Knut Wannheden
a0516326eb [jOOQ/jOOQ#8754] Fix regression in ConvertDateTime
The refactoring in `ConvertDateTime` was not quite correct for ORACLE
and POSTGRES. This has been fixed now by replacing some `break`
statements with `return` statements.
2019-06-21 09:07:19 +02:00
Knut Wannheden
4737223c9d [jOOQ/jOOQ#8833] Support DatePart.WEEK for Oracle 2019-06-21 09:05:10 +02:00
Knut Wannheden
5076b5eeff [jOOQ/jOOQ#8754] Remove more SQL templating
Removes SQL templating in expression, date, and timestamp related
functions as well as in a few other classes.
2019-06-20 17:03:34 +02:00