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 in KotlinGenerator generated code when GeneratorStrategy produces identifiers conflicting with property access syntax of AbstractRoutine getters #16006
Comments
Thanks for your report. I'm assuming this is about the functions from this extension? CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; I'll try reproducing this soon. |
@lukaseder yeah I guess so, though there may be other cases. |
Also, not just the /**
* Set the <code>NAME</code> parameter IN value to the routine
*/
internal fun setName_(value: Int?): Unit = setValue(name, value) // Same problem here
/**
* Set the <code>NAME</code> parameter to the function to be used with a
* {@link org.jooq.Select} statement
*/
internal fun setName_(field: Field<Int?>): Unit {
setField(name, field) // Same problem here
} |
Interestingly, we already do this qualification in the |
Hmm, IntelliJ will complain about "redundant qualifier name" in cases where this doesn't happen, i.e. in 99.9% of all cases. |
Thanks! |
when GeneratorStrategy produces identifiers conflicting with property access syntax of AbstractRoutine getters
when GeneratorStrategy produces identifiers conflicting with property access syntax of AbstractRoutine getters
when GeneratorStrategy produces identifiers conflicting with property access syntax of AbstractRoutine getters
when GeneratorStrategy produces identifiers conflicting with property access syntax of AbstractRoutine getters
Use case
From a style point of view, devs may prefer table names to be lowercased (uppercase is LOUD). Using a generator strategy in kotlin, you can do something like:
This generally works, but certain generated classes won't compile. For example, if you use a uuid generating function in your schema:
then the generated code for UUIDGeneratorV3 and V5 (though not V4) will have broken code:
Here "name" is meant to reference the companion object name, but in Kotlin at least it fails to resolve to anything. It seems like the naming strategy 95% works, with just some edge cases that need disambiguation.
Possible solution
No response
Possible workarounds
Using capitalized words is still less loud, and seems to work reasonably:
jOOQ Version
Jooq open source 3.18.6
Database product and version
Postgres 15
Java Version
OpenJDK version 17
OS Version
Ubuntu 23.10
JDBC driver name and version (include name if unofficial driver)
org.postgresql:postgresql:42.5.1
The text was updated successfully, but these errors were encountered: