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

Compilation error when 2 Oracle packages both contain the same record type name #10576

Closed
lukaseder opened this issue Sep 2, 2020 · 3 comments

Comments

@lukaseder
Copy link
Member

The following setup produces a compilation error as the generated record type reference is duplicated in the UDT.java class:

CREATE OR REPLACE PACKAGE p AS
  TYPE t IS RECORD (a NUMBER);
END p;
/
  
CREATE OR REPLACE PACKAGE p AS
  TYPE t IS RECORD (a NUMBER);
END p;
/
@lukaseder
Copy link
Member Author

This only affects the global references in the UDTs.java class, not the types themselves, nor their usage.

Workarounds include:

  • Turning off <globalUDTReferences>false</globalUDTReferences>
  • Using a generator strategy
  • Excluding the relevant packages or types using <excludes/>

@lukaseder
Copy link
Member Author

The problem is that these UDT types are generated in the wrong place, in the schema's UDTs.java file, when there should also be such a file per package. Changing this is backwards incompatible, as user code will no longer compile if someone references the UDTs this way. But it seems necessary, because the package UDTs can also collide with OBJECT types, this way.

@lukaseder
Copy link
Member Author

Fixed for jOOQ 3.14.0.

The fix depends on new API and breaks compatibility of generated code. I prefer not to backport it to 3.13.5. One of the existing workarounds documented here (#10576 (comment)) should be used.

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

No branches or pull requests

1 participant