[JAVA-2769] Ignore idProperty for embedded classes Created: 02/Feb/18 Updated: 20/Mar/18 Resolved: 06/Feb/18 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | POJO |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Ross Lawley | Assignee: | Ross Lawley |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
The id field will be converted to _id by annotations. Relies on the context of the encoding / decoding to be known and handled by the PojoCodec. |
| Comments |
| Comment by Ross Lawley [ 06/Feb/18 ] | ||||
|
There are two issues preventing this being handled by a single class. Currently, no context about how a PojoCodec is used is passed around by Codecs. Secondly, the conventions applied by annotations overwrite the meta data about the property read and write name, so once the property name is changed - it is effectively lost. However, storing data like so:
Is possible but would require either: multiple classes and / or the use of an interface and discriminators. As there are work arounds, I'm marking this as won't fix. |