-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.10.2
-
Component/s: POJO
-
Labels:None
The following code:
@BsonProperty("07") public long getCoin07() { return get07(); } public void setCoin07(long _07) { set07(_07); }
will make the property coin07 serialize as 07, but on deserializing the property is ignored.
Imho the setter should be used as the getter is annotated accordingly.
If some other setter is annotated with @BsonProperty("07"), it could be used as explicitly configured, but as long as that annotation is not present on any setter, I'd expect the matching setter be used automatically.
Just as clarification, there is no `coin07` field that could be annotated.
Annotating the setter too with said annotation makes it work properly.
- is related to
-
JAVA-3303 @BsonProperty on a getter is ignored if the field is not serialized anyway
- Backlog