spring-projects / spring-projects/spring-data-mongodb
Improve handling of mapped backing properties in kotlin classes [DATAMONGO-2140]
@mp911de is already working on this.
Since Dec 30, 2020.
- Dominant language
- Java
- Stars
- 1.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
Knut Schleßelmann opened DATAMONGO-2140 and commented
Currently I try to find the best solution to map backing properties in kotlin. This is a common pattern if you want to expose an internal mutable collection as a read only collection property in the public API of a class.
I provided a small sample of the problem at https://github.com/kschlesselmann/kotlin-spring-data-mongo-mapping which results in
org.springframework.data.mapping.MappingException: No property list found on entity class com.example.demomongomapping.Test to bind constructor parameter to!
if Spring Data tries to bind the Document to the Class again.
One suggestion in gitter was to add @Field to constructor arguments like @JsonProperty from Jackson
Affects: 2.1.2 (Lovelace SR2)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.