OK, thanks for the confirmation. I can see a warning in the logs, when
turning on JPA annotations:

11:09:05,377 [INFO] --- jooq-codegen-maven:3.15.0-SNAPSHOT:generate
(generate-daos) @ jooq-test-codegen-kotlin ---
java.lang.IllegalStateException: A formatting error has been produced by
https://github.com/jOOQ/jOOQ/issues/10196
        at org.jooq.codegen.GeneratorWriter.print(GeneratorWriter.java:162)
        at org.jooq.codegen.GeneratorWriter.print(GeneratorWriter.java:143)
        at
org.jooq.codegen.GeneratorWriter.println(GeneratorWriter.java:274)
        at
org.jooq.codegen.JavaGenerator.printTableJPAAnnotation(JavaGenerator.java:6734)
        at
org.jooq.codegen.JavaGenerator.generatePojo0(JavaGenerator.java:4155)
        at
org.jooq.codegen.JavaGenerator.generatePojo(JavaGenerator.java:4124)
        at
org.jooq.codegen.JavaGenerator.generatePojo(JavaGenerator.java:4105)
        at
org.jooq.codegen.JavaGenerator.generatePojos(JavaGenerator.java:4092)
        at org.jooq.codegen.JavaGenerator.generate(JavaGenerator.java:595)
        at org.jooq.codegen.JavaGenerator.generate(JavaGenerator.java:538)
        at org.jooq.codegen.JavaGenerator.generate(JavaGenerator.java:437)
        at org.jooq.codegen.GenerationTool.run0(GenerationTool.java:879)
        at org.jooq.codegen.GenerationTool.run(GenerationTool.java:233)
        at org.jooq.codegen.GenerationTool.generate(GenerationTool.java:228)
        at org.jooq.codegen.maven.Plugin.execute(Plugin.java:207)

I'll investigate this here: https://github.com/jOOQ/jOOQ/issues/10782

On Wed, Oct 21, 2020 at 6:14 PM David Karlsen <[email protected]>
wrote:

> Ok — that is reasonable.
> The annotations were generated like that
>
> ons. 21. okt. 2020 kl. 18:03 skrev Lukas Eder <[email protected]>:
>
>> Hi David,
>>
>> But it *is* nullable. In SQL, everything is nullable. Rationale here:
>>
>> https://blog.jooq.org/2017/07/25/5-things-you-may-not-have-known-about-jooq/#thing1
>>
>> One simple example would be using a LEFT JOIN:
>>
>> SELECT c.*
>> FROM x
>> LEFT JOIN t_customer c
>> ON false
>>
>> If you run this query with jOOQ, pretending that your columns are NOT
>> NULL would be a mistake. The same is true with unions, expressions, and
>> many other SQL features, and even with deferred constraints or triggers,
>> which we are currently unaware of.
>>
>> There might be a flag in the future that allows you to override this at
>> your own risk:
>> https://github.com/jOOQ/jOOQ/issues/10212
>>
>> In addition to that, you may choose to project only 2 columns but still
>> map your record into the POJO that has been generated. Another source of
>> nulls in jOOQ...
>>
>> Are those ill-formatted JPA annotations a copy paste artifact, or
>> generated that way?
>>
>> I hope this helps,
>> Lukas
>>
>> On Wed, Oct 21, 2020 at 5:42 PM David Karlsen <[email protected]>
>> wrote:
>>
>>> Great - now I get kotlin code!
>>> But I think the generator could be tightened a bit:
>>>
>>> create table T_CUSTOMER (
>>>     id number(19,0) not null, -- generated PK
>>>
>>>
>>> record:
>>>
>>> var id: BigInteger?
>>>     set(value) = set(0, value)
>>> @Id
>>> @Column(name = "ID", nullable = false, precision = 19)
>>>     get() = get(0) as BigInteger?
>>>
>>> if it is not nullable - then it can be BigInteger - not BigInteger?
>>>
>>> same with pojo:
>>>
>>> data class TCustomer(
>>>       var id: BigInteger? = null
>>>     , var version: BigInteger? = null
>>>     , var customerid: String? = null
>>>     , var orgid: String? = null
>>>     , var firstname: String? = null
>>>     , var lastname: String? = null
>>>     , var createdDt: LocalDateTime? = null
>>>     , var updatedDt: LocalDateTime? = null
>>> ): Serializable {
>>>
>>>
>>> wdyt?
>>>
>>> ons. 21. okt. 2020 kl. 16:45 skrev Lukas Eder <[email protected]>:
>>>
>>>> The code is the same, yes. But in order to activate it, you have to use:
>>>>
>>>> <configuration>
>>>>   <generator>
>>>>     <name>org.jooq.codegen.KotlinGenerator</name>
>>>>   </generator>
>>>> </configuration>
>>>>
>>>>
>>>> This will be documented soon.
>>>>
>>>> On Wed, Oct 21, 2020 at 3:19 PM David Karlsen <[email protected]>
>>>> wrote:
>>>>
>>>>> Isn't the same generator used under the hood from the maven plugin? I
>>>>> want Kotlin code since my app is kotlin (except for generated jooq and
>>>>> openapi code). If it is possible to get all code generated as Kotlin I'd
>>>>> prefer that.
>>>>> Thanks.
>>>>>
>>>>> ons. 21. okt. 2020 kl. 14:49 skrev Lukas Eder <[email protected]>:
>>>>>
>>>>>> Hi David,
>>>>>>
>>>>>> This flag currently requires using the KotlinGenerator. I guess it
>>>>>> would make sense to enable it also in the JavaGenerator? Was that your
>>>>>> expectation? Is there a reason why you'd like Kotlin data classes, but 
>>>>>> all
>>>>>> the other generated classes as ordinary Java classes?
>>>>>>
>>>>>> Thanks,
>>>>>> Lukas
>>>>>>
>>>>>> On Wed, Oct 21, 2020 at 2:28 PM David Karlsen <[email protected]>
>>>>>> wrote:
>>>>>>
>>>>>>> I have a configuration section like:
>>>>>>>
>>>>>>> <generate>
>>>>>>>   <javaTimeTypes>true</javaTimeTypes>
>>>>>>>   <jpaAnnotations>true</jpaAnnotations>
>>>>>>>   <jpaVersion>2.2</jpaVersion>
>>>>>>>   <pojosAsKotlinDataClasses>true</pojosAsKotlinDataClasses>
>>>>>>>   <pojosEqualsAndHashCode>true</pojosEqualsAndHashCode>
>>>>>>>   <pojos>true</pojos>
>>>>>>>   <daos>true</daos>
>>>>>>>   <validationAnnotations>false</validationAnnotations>
>>>>>>>   <springAnnotations>true</springAnnotations>
>>>>>>> </generate>
>>>>>>>
>>>>>>> but still the classes generated are .java and not Kotlin.
>>>>>>>
>>>>>>> --
>>>>>>> --
>>>>>>> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "jOOQ User Group" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to [email protected].
>>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/jooq-user/CAGO7Ob3zK2Nhqo0WCMMfLyMoqAEGzy2E7Cw6G-6XizkObXfYdQ%40mail.gmail.com
>>>>>>> <https://groups.google.com/d/msgid/jooq-user/CAGO7Ob3zK2Nhqo0WCMMfLyMoqAEGzy2E7Cw6G-6XizkObXfYdQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "jOOQ User Group" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to [email protected].
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/jooq-user/CAB4ELO4Y3hhFJ-%3DxP_JWQKse55DXTJcBHk4r6_-yV8tGOEs2%2Bg%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/jooq-user/CAB4ELO4Y3hhFJ-%3DxP_JWQKse55DXTJcBHk4r6_-yV8tGOEs2%2Bg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> --
>>>>> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "jOOQ User Group" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [email protected].
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/jooq-user/CAGO7Ob1jpOvyiEU%3DUz%2Bxj1B5XCU%3D7au731BsNDWO9VHXJRbdXQ%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/jooq-user/CAGO7Ob1jpOvyiEU%3DUz%2Bxj1B5XCU%3D7au731BsNDWO9VHXJRbdXQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "jOOQ User Group" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/jooq-user/CAB4ELO7Co4tPz-9MiqBEFyPRAHBF%3D2K5v1H9uZLdj8u_ynSY9w%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/jooq-user/CAB4ELO7Co4tPz-9MiqBEFyPRAHBF%3D2K5v1H9uZLdj8u_ynSY9w%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>
>>>
>>> --
>>> --
>>> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "jOOQ User Group" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jooq-user/CAGO7Ob2SzUEziCyp1q63Ck%3DCO-ZiqCicZ8ikc5LwwT93-7jdFA%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/jooq-user/CAGO7Ob2SzUEziCyp1q63Ck%3DCO-ZiqCicZ8ikc5LwwT93-7jdFA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "jOOQ User Group" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jooq-user/CAB4ELO7UNrH7r_DMTbpS4sGt0Xhm_q-gUTe%2Bsf26pWCfLzUziw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/jooq-user/CAB4ELO7UNrH7r_DMTbpS4sGt0Xhm_q-gUTe%2Bsf26pWCfLzUziw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>
> --
> You received this message because you are subscribed to the Google Groups
> "jOOQ User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jooq-user/CAGO7Ob1mKyY_H6J91qoKOThL6S8zPeaDLd1Xfk%3Du7UbQTiU%2BjA%40mail.gmail.com
> <https://groups.google.com/d/msgid/jooq-user/CAGO7Ob1mKyY_H6J91qoKOThL6S8zPeaDLd1Xfk%3Du7UbQTiU%2BjA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/CAB4ELO5GGHZri8vdBf2QRSyK1Wc2%2B%2BoZBF6cMM977j2U7V7m0Q%40mail.gmail.com.

Reply via email to