Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate.globalTableReferences should not impact what is returned by Schema#getTables() #9685

Closed
knutwannheden opened this issue Dec 18, 2019 · 4 comments

Comments

@knutwannheden
Copy link
Contributor

If the generator is run with Generate.globalTableReferences = false the generated Schema#getTables() method currently returns an empty list.

The documentation on this setting isn't very clear, but I would only have expected it to control whether the generated Schema and or Tables class declare Java fields corresponding to the tables, but Schema#getTables() to remain unaffected.

@lukaseder
Copy link
Member

Good discovery! The flags Generate.globalXYZ should prevent the generation of auxiliary files like Tables.java, which are not strictly necessary. Tables.java, for example, references a pre-existing singleton table reference from each table for the schema. The Schema::getTables method could reference those instances directly in generated code, without any side-effect.

@lukaseder lukaseder self-assigned this Dec 19, 2019
@lukaseder
Copy link
Member

Not all globalXYZ flags are the same (currently). In some cases, the global reference is all there is, e.g. with sequences, queues, links.

@lukaseder
Copy link
Member

Interestingly, the generated code is already working this way, so this is merely a matter of removing a check for globalXYZ. Tables and UDTs are affected.

lukaseder added a commit that referenced this issue Dec 19, 2019
3.13 DDL interpretation automation moved this from To do to Done Dec 19, 2019
@lukaseder
Copy link
Member

Fixed in jOOQ 3.13.0. Backport scheduled for 3.12.4 (#9691)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants