Skip to content

Improve handling of mapped backing properties in kotlin classes [DATAMONGO-2140] #3009

Open
@spring-projects-issues

Description

@spring-projects-issues

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)

Metadata

Metadata

Assignees

Labels

in: mappingMapping and conversion infrastructuretype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions