You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@davidjoh0 - The current implementation expects/requires that the keys of a Map are Strings. The purpose of EnumMapper is different than what you need. In essence, the developers (through an annotation) provide a way to convert a Map's key into String (while writing to the Datastore) and String to Map's key (while reading from the Datastore). I've marked this as an enhancement request. If you are willing to contribute, let me know.
A temporary solution could be to attach a custom mapper for your map field and let the mapper handle the data mapping to/from Datastore. If you plan to have many maps with all types of keys, this may not be the best solution. A customer mapper can be attached as shown below:
Just to clarify; in the current implementation it is not possible to add a Enum<>String mapper to a Map key (this would require changes in the framework), but I could build a custom property mapper which could fix our specific issue.
I will proceed with the custom mapper solution.
btw, the catatumbo framework is very useful and has been easy to use!
Hello,
We get an error when we try to save an entity which contains a Map with an enum as the key. Is there a workaround for this, e.g. a PropertyMapper?
Catatumbo provides an enum mapper, could this be applied to an enum as a Map key?
Thanks,
David
The text was updated successfully, but these errors were encountered: