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

Correct OneToMany relationship for immutable data classes #1072

Merged
merged 3 commits into from
Jul 4, 2021

Conversation

dstepanov
Copy link
Contributor

Fixes #1054

@graemerocher graemerocher merged commit 7ea4c1f into master Jul 4, 2021
@graemerocher graemerocher deleted the fix-first-chld branch July 4, 2021 10:15
@PiotrBaczkowski
Copy link

PiotrBaczkowski commented Sep 27, 2021

Definitely my knowledge is not good enough to fix this, but shouldn't kotlin mapping work also with vars and not vals in data classes?

if somebody comes across this issue,
as for now TO ONE relationships has to be vars
TO MANY relationship has to be vals to make it work properly

@graemerocher if its intended then I will be more than happy to update docs about it.

@dstepanov
Copy link
Contributor Author

It's supposed to work, there are some scenarios like bi-directional relationships that cannot be supported for immutable classes.

Can you please create a PR with your example and add it here https://github.com/micronaut-projects/micronaut-data/tree/master/doc-examples/jdbc-example-kotlin/src/main/kotlin/example

Docs are always welcome but let's first take a look at your case.

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