[JAVA-2599] Improve how the `ConventionAnnotationImpl` looks up property names in the context of `@bsonCreator`. Created: 15/Sep/17  Updated: 29/Oct/23  Resolved: 04/Dec/17

Status: Closed
Project: Java Driver
Component/s: POJO
Affects Version/s: None
Fix Version/s: 3.6.0

Type: Improvement Priority: Major - P3
Reporter: Ross Lawley Assignee: Ross Lawley
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to JAVA-4833 Using @BsonId in a @BsonCreator const... Closed

 Description   

Currently, it uses the property name and not the write property name which may make more sense.

See: https://github.com/mongodb/mongo-java-driver/pull/413



 Comments   
Comment by Githook User [ 04/Dec/17 ]

Author:

{'username': 'rozza', 'email': 'ross.lawley@gmail.com', 'name': 'Ross Lawley'}

Message: Fix ConventionAnnotation handling of legacy BsonProperty

JAVA-2599
Branch: 3.6.x
https://github.com/mongodb/mongo-java-driver/commit/6a138775236d74127d7765bf326a4a08faed1298

Comment by Githook User [ 04/Dec/17 ]

Author:

{'username': 'visualage', 'email': 'qliu@deal.com', 'name': 'Qi Liu'}

Message: BsonCreator and BsonProperty improvements

Added support for using BsonId with the BsonCreator.
Allow BsonProperty to rename properties.
Default using the write name for the BsonProperty, if not found fallback to existing getter.

JAVA-2599
Branch: 3.6.x
https://github.com/mongodb/mongo-java-driver/commit/b376aa4648c0fa82842713eba56dfa3ab7623e5d

Comment by Ross Lawley [ 04/Dec/17 ]

A massive thank you to Qi Liu for the excellent pull request.

Comment by Githook User [ 04/Dec/17 ]

Author:

{'username': 'rozza', 'email': 'ross.lawley@gmail.com', 'name': 'Ross Lawley'}

Message: Fix ConventionAnnotation handling of legacy BsonProperty

JAVA-2599
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/6a138775236d74127d7765bf326a4a08faed1298

Comment by Githook User [ 04/Dec/17 ]

Author:

{'username': 'visualage', 'email': 'qliu@deal.com', 'name': 'Qi Liu'}

Message: BsonCreator and BsonProperty improvements

Added support for using BsonId with the BsonCreator.
Allow BsonProperty to rename properties.
Default using the write name for the BsonProperty, if not found fallback to existing getter.

JAVA-2599
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/b376aa4648c0fa82842713eba56dfa3ab7623e5d

Generated at Thu Feb 08 08:57:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.