Open lukaseder opened 2 months ago
This configuration:
<execution> <id>generate-embeddabledomainsinterfaces</id> <phase>generate-test-sources</phase> <goals> <goal>generate</goal> </goals> <configuration> <generator> <database> <name>org.jooq.meta.extensions.ddl.DDLDatabase</name> <properties> <property> <key>scripts</key> <value>${basedir}/src/main/resources/embeddabledomains.sql</value> </property> </properties> <embeddableDomains>.*</embeddableDomains> </database> <generate> <interfaces>true</interfaces> <pojos>true</pojos> <records>true</records> </generate> <target> <packageName>org.jooq.codegen.test.embeddabledomainsinterfaces.db</packageName> </target> </generator> </configuration> </execution>
Produces bad code generation output with the KotlinGenerator where the generated interface is this:
KotlinGenerator
internal interface IEmbeddableDomains_2 : Serializable { var id: Int? var e: IDEmail var y: IDYear // ... }
... and the implementation is this:
internal class EmbeddableDomains_2( override var id: Int? = null, override var e: DEmail? = null, override var y: DYear? = null ): IEmbeddableDomains_2 { ... }
There are 2 problems:
This would be a valid alternative, for example:
internal class EmbeddableDomains_2( override var id: Int? = null, override var e: IDEmail = DEmail(null), override var y: IDYear = DYear(null) ): IEmbeddableDomains_2 { ... }
To be further investigated. There are probably other, related issues (e.g. combining UDTs with interfaces)
This doesn't affect the ScalaGenerator as in Scala, we do not declare properties in interfaces. That feature is available in Kotlin only
ScalaGenerator
This configuration:
Produces bad code generation output with the
KotlinGenerator
where the generated interface is this:... and the implementation is this:
There are 2 problems:
This would be a valid alternative, for example:
To be further investigated. There are probably other, related issues (e.g. combining UDTs with interfaces)