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

Product.kt example — remove nullable type on association property #1376

Open
wants to merge 1 commit into
base: 4.7.x
Choose a base branch
from

Conversation

avarun42
Copy link

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.

@CLAassistant
Copy link

CLAassistant commented Mar 10, 2022

CLA assistant check
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.

@dstepanov
Copy link
Contributor

It looks like it failed with Null can not be a value of a non-null type Manufacturer

@avarun42
Copy link
Author

avarun42 commented Apr 7, 2022

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.

@avarun42
Copy link
Author

If somebody can point me to where to update the test to expect a thrown exception I can update this PR.

@dstepanov
Copy link
Contributor

Can you rebase it and force push? So we will have a fresh run and see what test was failing.

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

Successfully merging this pull request may close these issues.

3 participants