Commit Graph

4574 Commits

Author SHA1 Message Date
Knut Wannheden
d2cb5570b2 [jOOQ/jOOQ#8986] Consistent naming of "org.jooq.ddl" context data keys
Make sure all key references use a consistent "org.jooq.ddl" prefix.
2019-08-27 21:12:17 +02:00
Knut Wannheden
147345304b [jOOQ/jOOQ#8986] New DSLContext#meta(Source...) API
Adds a new internal `DSLContext#meta(Source...)` API which can be used to construct a `Meta` object for a list of DDL scripts (similarly to the existing `DDLDatabase`), but for other use cases such as the `Parser`.

This new method uses the new internal `Source` abstraction to represent a DDL script, which can be constructed using any of the existing static `of()` factory methods or optionally by a custom implementation class.
2019-08-27 21:11:30 +02:00
Knut Wannheden
d092e1b6ef [jOOQ/jOOQ#9082] ResultQuery.fetchStream() and similar overloads should add an explicit statement about resulting streams being resourceful 2019-08-27 21:10:27 +02:00
Lukas Eder
feed7665c9 [jOOQ/jOOQ#9078] Improve MockFileDatabase error message "Invalid SQL" 2019-08-26 10:21:30 +02:00
Knut Wannheden
2b3532d4c5 [jOOQ/jOOQ#9063] Support ALTER TABLE ... DROP PRIMARY KEY for Derby 2019-08-23 10:06:36 +02:00
Knut Wannheden
5830b1b0d5 [jOOQ/jOOQ#9071] Fix for DefaultConfiguration#derive()
`DefaultConfiguration#derive()` could lead to surprising effects because
the derived `Configuration` would be linked to a `MetaProvider` which
still referenced the original `Configuration`.
2019-08-22 14:24:10 +02:00
Knut Wannheden
66a45669c4 [jOOQ/jOOQ#8918] Use Java 6 compatible SchemaFactory API 2019-08-21 17:15:41 +02:00
Knut Wannheden
fb01e29114 [jOOQ/jOOQ#9070] Use new constants in MiniJAXB 2019-08-21 15:31:57 +02:00
Knut Wannheden
bda1ec9b7f [jOOQ/jOOQ#8918] Log warnings regarding unknown elements
The `MiniJAXB` implementation now attempts to validate the input XML against the corresponding XSD schema and will log warnings when there are validation errors (e.g. unknown elements).
2019-08-21 15:29:00 +02:00
Lukas Eder
590cdf1821 [jOOQ/jOOQ#9070] Add Constants.CP_RUNTIME and other values 2019-08-21 15:03:42 +02:00
Lukas Eder
4356de54b2 [jOOQ/jOOQ#9065] Parser does not support NVARCHAR2 2019-08-21 10:54:13 +02:00
Knut Wannheden
25cc3e6fd9 [jOOQ/jOOQ#8238] Support DSL#convert() for POSTGRES
Adds POSTGRES support to `DSL#convert()`.
2019-08-20 14:13:57 +02:00
Knut Wannheden
eaadafa8bf Cleanup: Remove some unnecessary preprocessor whitespace 2019-08-20 12:42:23 +02:00
Knut Wannheden
3933ad94ee [jOOQ/JOOQ#9064] Support HSQLDB in DSL#week() 2019-08-20 10:03:52 +02:00
Knut Wannheden
345fbe29fb [jOOQ/jOOQ#9063] Add HSQLDB to AlterTableStep#dropPrimaryKey() 2019-08-20 09:52:23 +02:00
Knut Wannheden
e5768e6b51 [jOOQ/jOOQ#9062] Add internal AlterTableImpl#dropColumns0()
Extract `AlterTableImpl#dropColumns()` into
`AlterTableImpl#dropColumns0()` which is now also directly called by
`AlterTableImpl#dropColumn()`.
2019-08-20 09:44:33 +02:00
Lukas Eder
0e63ae8064 [jOOQ/jOOQ#9059] DSLContext.ddl(Catalog) does not correctly create cross schema foreign key constraints. 2019-08-19 11:40:55 +02:00
Lukas Eder
0f5b8799b9 [jOOQ/jOOQ#9048] Delete module-info.java.invalid files 2019-08-16 14:02:45 +02:00
Knut Wannheden
a144a1402d [jOOQ/jOOQ#8964] Always cast decimals with scale in toSQL92Values()
The SQL Server workaround does not always work correctly when the
`CAST()` is only applied to the values of the first row.
2019-08-15 16:53:24 +02:00
Lukas Eder
56d25586cc [jOOQ/jOOQ#9043] Provide minimal internal implementation 2019-08-15 16:18:27 +02:00
Knut Wannheden
c6eaa9ef3c [jOOQ/jOOQ#8964] Fix bulk INSERT of DECIMAL with scale values
SQL Server has a bug when it comes to bulk inserting DECIMAL with scale
values (see https://github.com/microsoft/mssql-jdbc/issues/1021 for
details). As a workaround jOOQ will in this scenario explicitly cast the
corresponding column values in the bulk set.
2019-08-15 15:18:22 +02:00
Knut Wannheden
ad60d8e198 Revert "[jOOQ/jOOQ#8964] Fix bulk INSERT of DECIMAL with scale values"
This reverts commit e929ea561728f521b38ce860d0937ea96ab092f9.
2019-08-15 15:15:31 +02:00
Lukas Eder
0450643f1f [jOOQ/jOOQ#9034] JDBCUtils.driver(String) returns deprecated "com.mysql.jdbc.Driver" 2019-08-15 09:13:40 +02:00
Knut Wannheden
8c7d18343d [jOOQ/jOOQ#9037] Add missing @Support annotations to CaseWhenStep
Annotation was missing on mapFields() and mapValues().
2019-08-14 16:47:46 +02:00
Knut Wannheden
fb26959736 [jOOQ/jOOQ#9036] Add @Support to SelectSeekStep<N> types
Annotation was missing on SelectSeekStep<N> type methods.
2019-08-14 16:35:25 +02:00
Knut Wannheden
9a55140c2f [jOOQ/jOOQ#9035] TERADATA support for onDuplicateKeyUpdate()
TERADATA was missing in the `@Support` annotation of
`InsertOnDuplicateStep#onDuplicateKeyUpdate()`.
2019-08-14 16:34:10 +02:00
Lukas Eder
5828de119c [jOOQ/jOOQ#9028] Fix also ALTER SEQUENCE statement 2019-08-13 16:08:27 +02:00
Lukas Eder
b1d9fceddf [jOOQ/jOOQ#9030] Add AlterSequenceStep.restartWith(Field<? extends T>) overload 2019-08-13 16:06:47 +02:00
Lukas Eder
972c89c40b [jOOQ/jOOQ#9028] Translated sequence flags in CREATE SEQUENCE statement get turned into bind variables 2019-08-13 15:54:53 +02:00
Lukas Eder
bc897d026d [jOOQ/jOOQ#9022] Added Javadoc 2019-08-13 13:51:30 +02:00
Lukas Eder
e2a761e8d2 [jOOQ/jOOQ#8993] NullPointerException when JDBC driver returns null on getGeneratedKeys call using ZDAL5 driver on MySQL 2019-08-13 11:35:39 +02:00
Lukas Eder
621ba842ed [jOOQ/jOOQ#9011] Fix parameter order 2019-08-13 10:57:14 +02:00
Knut Wannheden
a103670197 [jOOQ/jOOQ#8596] Add MySQL support for onConflictOnConstraint()
Add `MYSQL` to `@Support` annotation on
`InsertOnDuplicateStep#onConflictOnConstraint()`, since this is
consistent with `InsertQuery#onConflictOnConstraint()` and supported for
the `doNothing()` step.
2019-08-09 16:21:39 +02:00
Knut Wannheden
928124a5cf [jOOQ/jOOQ#8912] Add reference to trueCondition() and falseCondition()
The Javadoc deprecation notice for methods deprecated with
jOOQ/jOOQ#4763 now references the `DSL` methods `noCondition()`,
`trueCondition()`, and `falseCondition()`.
2019-08-09 14:51:40 +02:00
Knut Wannheden
6c15996371 [jOOQ/jOOQ#9011] Support CURRENT_TIMESTAMP(<precision>)
`DSL#currentTimestamp()` and `DSL#now()` have been overloaded with a
method declaring a `Field<Integer>` parameter, representing the
precision for the timestamp function. Many dialects support this.

Also the parser can now parse expressions like `NOW(6)`.
2019-08-08 10:42:02 +02:00
Knut Wannheden
1ec32db4bc [jOOQ/jOOQ#9009] Fix AbstractMeta constructor
Caches are now initialized lazily.
2019-08-06 18:38:54 +02:00
Knut Wannheden
7da5918be7 [jOOQ/jOOQ#9009] Consistent caching in AbstractMeta
`AbstractMeta` now implements caching for all methods defined by the
`Meta` interface.
2019-08-06 18:37:34 +02:00
Knut Wannheden
dc7ce900e9 [jOOQ/jOOQ#8986] Extracted DDLDatabaseInitializer
Extracted new class DDLDatabaseInitializer from DDLDatabase. This new
class is in package `org.jooq.extensions.ddl` of Maven module
`jOOQ-extensions`.

As a consequence also renamed the configuration data keys
"org.jooq.meta.extensions.ddl.ignore-storage-clauses" and
"org.jooq.meta.extensions.ddl.parse-for-ddldatabase" to
"org.jooq.extensions.ddl.ignore-storage-clauses" and
"org.jooq.extensions.ddl.parse-for-ddldatabase" respectively.
2019-08-06 11:05:11 +02:00
Knut Wannheden
2825bbdf2a [jOOQ/jOOQ#9001] DefaultRecordMapper now uses RecordMapperProvider
Having the `DefaultRecordMapper` internally also use
`Configuration#recordMapperProvider()` is important when the user needs
control over how nested POJOs get mapped.
2019-07-31 14:54:31 +02:00
Knut Wannheden
acc47ecb37 [jOOQ/jOOQ#8754] Remove more SQL templating
- Got rid of a few more SQL templating cases
- Removed some unnecessary nullSafe() calls
- Use nullSafeDataType() where appropriate
- Fix regression in OracleDSL#matches(Field, String, int)
2019-07-31 09:03:41 +02:00
Knut Wannheden
0dce3122d8 [jOOQ/jOOQ#5806] H2 has standard TIMESTAMP WITH TIME ZONE literals
Removed H2 specific code for rendering of TIMESTAMP WITH TIME ZONE
literals, as the SQL standard notation now also works.
2019-07-30 17:30:47 +02:00
Knut Wannheden
9c5980a7df [jOOQ/jOOQ#8964] Fix bulk INSERT of DECIMAL with scale values
SQL Server has a bug when it comes to bulk inserting DECIMAL with scale
values (see https://github.com/microsoft/mssql-jdbc/issues/1021 for
details). As a workaround jOOQ will in this scenario explicitly cast the
first column value in the bulk set.
2019-07-30 13:06:21 +02:00
Lukas Eder
4d6bbc902b [jOOQ/jOOQ#8987] Improve MockResult Javadoc 2019-07-26 15:47:44 +02:00
Lukas Eder
854375dbcf [jOOQ/jOOQ#7789] Revert change
The jOOQ 3.12 Open Source Edition will continue to support Java 8. The only things we gain from the JDK 11 dependency is:

- Updated logic for reflection when mapping into proxied default methods (that stuff has changed completely in JDK 9). This is a regression, which we can live with. The workaround is to write a custom
- Explicit dependency on the JDK 9  API, for which we provide a Java 8 compatible alternative via reactive streams anyway.
- JDBC 4.3 compatibility (mostly sharding). We currently don't use that yet.

We're not even using  internally, outside of a few integration tests. So, we'll postpone the JDK 11 *requirement* (while supporting it nonetheless) to a later release, e.g. 3.13. We'll observe market share shifts. Currently Java 11's market share is a bit of a disappointment, so making it a requirement might be premature.
2019-07-26 15:18:18 +02:00
Lukas Eder
df4b94d765 [jOOQ/jOOQ#7242] Declare JSON type before JSONB type as a default 2019-07-26 14:41:00 +02:00
Lukas Eder
5b1b37fe35 Added Mustafa Yücel to contributors 2019-07-25 17:22:32 +02:00
Lukas Eder
990bfa4663 [jOOQ/jOOQ#8939] Various fixes
- Fixed a bug when FlywayFileComparator compares non-flyway files
- Added a unit test
- Added examples to jOOQ-examples module as submodules
- Split flyway migration in one more migration file
- Check in generated sources
2019-07-25 15:51:37 +02:00
Lukas Eder
38ed342821 [jOOQ/jOOQ#8982] Add a SingleConnectionDataSource 2019-07-25 15:28:05 +02:00
Lukas Eder
4e9a29dbd6 [jOOQ/jOOQ#8972] jOOQ-meta should query dictionary views for column
existence rather than the column itself
2019-07-23 12:35:09 +02:00
Lukas Eder
24f703eeb3 [jOOQ/jOOQ#8294] Give user feedback in interactive mode 2019-07-17 16:36:02 +02:00