Open e-hucke opened 2 months ago
@Rawi01 I also encounter this problem. And it's very critical. Please consider adding this feature
I also came across a similar requirement and suggested a possible approach here: #3477. Would be very useful if it's implemented in @FieldNameConstants
Problem is that I have I class used for Spring Data MongoDB with a field called "id". @FieldNameConstants will generate ExampleClass.Fields.id = "id" but I need it to be "_id"
The current workaround to overwrite this field would be:
This solution is pretty ugly/complex and kind of defeats the point of easy to use annotations.
What I would like to see implemented:
FieldNameConstants is super useful for writing db queries but using it with fields that get serialized differently into the db is cumbersome since you either have to hardcode the strings into the query or use the workaround above