Commit Graph

777 Commits

Author SHA1 Message Date
Lukas Eder
54e8a53628 [jOOQ/jOOQ#9732] Change default value of <generatedAnnotation/> to
"false"
2020-01-15 13:57:20 +01:00
Lukas Eder
45097fd05d [jOOQ/jOOQ#8677] Log warning when file based databases have invalid <jdbc/> configurations 2020-01-14 17:23:57 +01:00
Lukas Eder
cff813a73e [jOOQ/jOOQ#9727] Add configuration/basedir to resolve relative paths in
code generator
2020-01-14 15:41:37 +01:00
Lukas Eder
36981a1198 [jOOQ/jOOQ#9697] Full identifier qualification in generated code when <globalObjectReferences> is turned off 2019-12-23 10:53:55 +01:00
Knut Wannheden
91fde41fb9 [jOOQ/jOOQ#9272] Avoid fully qualified class references when possible
In the generated `CatalogImpl` subclasses the static fields representing
the schemas of the catalog typically don't need a fully qualified class
reference in the initializer expression, since the Java type is imported
already.

Additionally the Javadoc comment of the field representing the default
schema (if any) will now also include the schema's name (before it was
missing).
2019-12-20 11:19:04 +01:00
Knut Wannheden
05a37398f0 [jOOQ/jOOQ#9272] Fix Javadoc of default catalog and schema singletons
Fixes the Javadoc comment of the default catalog and schema singletons
generated into the `CatalogImpl` and `SchemaImpl` subclasses. For the
default catalog and schema the name was always empty.
2019-12-20 11:05:24 +01:00
Knut Wannheden
171637eaed [jOOQ/jOOQ#9272] Avoid fully qualified class references when possible
In the generated `SchemaImpl` subclasses the static fields representing
the tables of the schema typically don't need a fully qualified class
reference in the initializer expression, since the Java type is imported
already.
2019-12-20 10:39:12 +01:00
Lukas Eder
e0cc5a4763 [jOOQ/jOOQ#9696] Add a new <generateGlobalIndexReferences/> flag
- This also fixes [jOOQ/jOOQ#9582]
2019-12-19 17:39:37 +01:00
Lukas Eder
a9df7649b1 [jOOQ/jOOQ#9685] Generate.globalTableReferences should not impact what
is returned by Schema#getTables()
2019-12-19 10:52:33 +01:00
Knut Wannheden
fb0a53b200 [jOOQ/jOOQ#9272] Simplify generated Schema and Catalog classes
The genereated `SchemaImpl` and `CatalogImpl` subclasses will only
declare methods like `getSchemas0()` and `getTables0()` when necessary.
I.e. when the number of returned definitions exceeds 500.
2019-12-18 17:29:01 +01:00
Lukas Eder
349b73f540 [jOOQ/jOOQ#9663] Regenerated test code 2019-12-12 18:13:14 +01:00
Lukas Eder
f1bbecc136 [jOOQ/jOOQ#9663] Add code generator support for NOT ENFORCED constraint flag
This depends on [jOOQ/jOOQ#9672] Add ConstraintDefinition
2019-12-12 17:34:44 +01:00
Knut Wannheden
b21a8c5f38 [jOOQ/jOOQ#9442] Support BigInteger for sequence flags
Java (and Scala) generator now also supports sequence flags where the
value is of type `BigInteger`.
2019-12-11 11:42:19 +01:00
Knut Wannheden
aa963f3010 [jOOQ/jOOQ#9629] Add "sequenceFlags" option to code generator
The `<generate>` element now has a `<sequenceFlags>` element which can
be used to disable the sequence flags generation, which is enabled by
default.
2019-12-05 14:29:09 +01:00
Knut Wannheden
791ed71c5b [jOOQ/jOOQ#9603] Change names to conform with SQL standard
The names of the XML elements in `jooq-meta-3.13.0.xsd` corresponding to
sequence flags have been changed to conform with the SQL standard.

Additionally the type of the numeric sequence flags have been changed
from `Long` to `BigInteger` and consequently also in other APIs from
`Long` to `Number`.
2019-12-05 13:51:48 +01:00
Knut Wannheden
9940a56afa [jOOQ/jOOQ#9603] Support sequence flags in jooq-meta.xsd
Sequence flags are now also supported in the jooq-meta.xsd model and
everywhere where this is used.
2019-12-04 17:17:03 +01:00
Lukas Eder
53f7cc0c79 [jOOQ/jOOQ#9601] Add <includeSystemIndexes/> 2019-12-03 09:39:00 +01:00
Lukas Eder
c7378bbc63 [jOOQ/jOOQ#9600] WIP 2019-11-28 14:04:25 +01:00
Knut Wannheden
791c69a9c7 [jOOQ/jOOQ#9442] Add sequence flags to code generator
Adds an overload factory method `Internal#createSequence()` which
accepts the sequence flags as individual parameters. The Java and Scala
code generators now generate code using this factory method.

So far only the `H2Database` knows how to supply the sequence flags to
the code generator. Other dialects supporting sequences will follow in
follow-up commits.

Also note that support for the `ORDER` flag will be added separately
(see jOOQ/jOOQ#9346).
2019-11-27 14:14:42 +01:00
Knut Wannheden
a2674732c9 [jOOQ/jOOQ#9565] Fix code generator for H2 inline checks 2019-11-27 11:49:59 +01:00
Knut Wannheden
fcc90d0c5a [jOOQ/jOOQ#9442] Code generator uses factory method for sequences
Instead of generating code which directly uses the `SequenceImpl`
constructor, the generator now emits code using a static factory method
in the `Internal` factory class.

Also removes duplicate H2 dependency from `jOOQ/pom.xml`.
2019-11-27 10:04:08 +01:00
Lukas Eder
57121c96e2 [jOOQ/jOOQ#7639] Add code generation support for CHECK constraints 2019-11-19 12:26:15 +01:00
Lukas Eder
ba7a030c82 [jOOQ/jOOQ#9565] Generate check clause in XMLGenerator 2019-11-19 10:18:18 +01:00
Lukas Eder
cd71da22f9 [jOOQ/jOOQ#8967] Generator outputs duplicate method (not compilable) 2019-11-15 13:50:41 +01:00
Lukas Eder
1f9fb4dfdb [jOOQ/jOOQ#8545] WIP 2019-11-08 16:43:58 +01:00
Lukas Eder
941bf0ed4a [jOOQ/jOOQ#9520] Log info message when a forcedType never matches 2019-11-08 13:55:55 +01:00
Lukas Eder
6b174bfbe0 [jOOQ/jOOQ#6497] Fixed NPE regression when <generate/> element is absent 2019-10-01 09:15:54 +02:00
Lukas Eder
3633b53f1e [jOOQ/jOOQ#6497] Add LocalDateAsLocalDateTimeBinding to make <javaTimeTypes/> and <dateAsTimestamp/> work together 2019-09-30 09:41:01 +02:00
Lukas Eder
77802eeb7b [jOOQ/jOOQ#5714] Change <javaTimeTypes/> default value to true 2019-09-27 14:55:37 +02:00
Lukas Eder
f1568d475a [jOOQ/jOOQ#9276] Consistently use same line terminators in generator
Also for the import list the Java / Scala generators now use the
configured line terminator rather than a hardcoded  terminator.
2019-09-26 10:42:28 +02:00
Lukas Eder
d18b17d44d [jOOQ/jOOQ#9150] Compilation error in generated code when Oracle OBJECT type contains index_of(varchar2) member procedure 2019-09-03 17:43:35 +02:00
Knut Wannheden
d27dbf4117 Preparing master for 3.13 release cycle 2019-08-29 16:12:59 +02:00
Lukas Eder
0f5b8799b9 [jOOQ/jOOQ#9048] Delete module-info.java.invalid files 2019-08-16 14:02:45 +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
Kaan Ozdokmeci
e8e230ae2c make generatePojoMultiConstructor protected inline with it's javadoc 2019-07-23 19:47:08 +03:00
Lukas Eder
cacc3e5a7c [jOOQ/jOOQ#8932] Use diamond operator in jOOQ code 2019-07-11 11:55:51 +02:00
Lukas Eder
f43815aa73 [jOOQ/jOOQ#8925] Add DAO.fetchRangeOf(Field<Z>, Z, Z) 2019-07-10 15:05:52 +02:00
Knut Wannheden
8b04f08e15 [jOOQ/jOOQ#8919] Implement formatting in MiniJAXB
The formatting logic is encapsulated by the new internal `XMLBuilder`
class which also required a new internal interface `XMLAppendable` which
is implemented by all XJC generated classes.

The XJC plugin was modified accordingly and all code was regenerated.

Also note that the `MiniJAXB` class was moved to package
`org.jooq.util.jaxb.tools`.
2019-07-10 11:26:58 +02:00
Knut Wannheden
9020e4eb42 [jOOQ/jOOQ#8914] Consistently use MiniJAXB 2019-07-09 14:34:17 +02:00
lukaseder
1b0113cc25 [jOOQ/jOOQ#8905] Use GeneratorWriter.encoding() instead of "UTF-8" 2019-07-05 13:46:15 +02:00
Lukas Eder
bcdadee556 [jOOQ/jOOQ#8905] GeneratorWriter should check the file size prior to
opening existing files to compare contents
2019-07-04 17:15:09 +02:00
Lukas Eder
514f2eda6d [jOOQ/jOOQ#5412] Reverted the feature 2019-07-03 15:27:09 +02:00
Lukas Eder
06b3e0aecd [#8863] Fix for ScalaGenerator 2019-07-02 09:43:07 +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
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
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
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
Lukas Eder
5aee8a9b5d [jOOQ/jOOQ#5412] Generate a Record from POJO unmapper on generated
records
2019-06-18 17:04:54 +02:00