micronaut-data
micronaut-data copied to clipboard
Product.kt example — remove nullable type on association property
Manufacturer? -> Manufacturer
If you look at the docs in https://github.com/micronaut-projects/micronaut-data/blob/master/src/main/docs/guide/sql/dbc/sqlMapping/sqlAssociationFetching.adoc, they state:
an exception will occur since the manufacturer association is not Nullable.
Then state to solve this by:
in Kotlin add ? to the end of the constructor argument name
However the example already is nullable and has a ? at the end of the property type. This seems to be a mistake.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
It looks like it failed with Null can not be a value of a non-null type Manufacturer
It looks like it failed with
Null can not be a value of a non-null type Manufacturer
From my reading of this section of the docs though, it seems like this example snippet is supposed to throw an exception of this kind.
If you look at the Java example for the same section, the manufacturer relation is explicitly not marked as nullable. The Kotlin example isn't consistent with the Java example or with the written docs themselves.
If somebody can point me to where to update the test to expect a thrown exception I can update this PR.
Can you rebase it and force push? So we will have a fresh run and see what test was failing.