Skip to content

Insertable and un-updatable field annotation [DATAMONGO-2514] #3369

Closed as not planned
@spring-projects-issues

Description

@spring-projects-issues

yejianfengblue opened DATAMONGO-2514 and commented

Is it possible to add an annotation to make a field insertable on creation but not updatable on update? That is an equivalent of JPA @Column(insertable = true, updatable = false).

For some fields which is part of business key, they should be persisted on creation, but not on update. Currently Spring Data MongoDB checks Spring Data annotation @Transient and @ReadOnlyProperty, but both annotations make the field NOT insertable also


Affects: 2.2.6 (Moore SR6)

Metadata

Metadata

Labels

in: mappingMapping and conversion infrastructurestatus: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions