[JAVA-3815] Pojo Codec does not detect property models on extended interfaces Created: 14/Aug/20 Updated: 10/Mar/23 |
|
| Status: | Backlog |
| Project: | Java Driver |
| Component/s: | POJO |
| Affects Version/s: | 4.1.0 |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Joseph Florencio | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Epic Link: | Investigate our POJO implementation |
| Quarter: | FY23Q4, FY24Q2 |
| Backwards Compatibility: | Minor Change |
| Description |
|
I created a pull request, so copying the text from that: If we have an interface like:
which is implemented as:
and has a concrete implementation that's called `SampleImplementorImpl`.
The presence of the `@BsonProperty` on the `@BsonCreator` method will Simply put, if you provide the pojo codec a class that is not concrete, We've worked around this problem for years and created 700+ hand written This fix is relatively straight forward: Update `PojoBuilderHelper` to |
| Comments |
| Comment by Joseph Florencio [ 14/Jan/21 ] |
|
Just wanted to follow up here, any chance the team can look into this..? |
| Comment by Joseph Florencio [ 05/Oct/20 ] |
|
Hey Jeffrey, No worries. I'm currently not blocked since I created a fork of the MongoDB Java Driver with my PR above that my organization is using. Would be ideal to have some type of solution eventually so we don't need to be on this fork permanently though. Generally speaking, I don't think there is an alternative workaround that doesn't involve forking since adding property models to ClassModelBuilder isn't an exposed API. |
| Comment by Jeffrey Yemin [ 30/Sep/20 ] |
|
Hi joe@deal.com First of all, sorry for not responding earlier. Thanks for reporting the issue to us, and for the pull request. We will look into it as time permits. Until then, do you have a workaround available? |
| Comment by Joseph Florencio [ 14/Aug/20 ] |
|
PR is here: https://github.com/mongodb/mongo-java-driver/pull/563 |