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
We are unable to persist Maps which have non primitve types (i.e. their wrapper types) as key. We need a new BeanConverterExtenstion that is able to convert and revert Maps of the type Map<Object, Object> in a way that the Objects are converted to PersistentBeans.
MapPrimitiveKeyExtension converts the key to a String, so that the key can be used as a property name in JSON:
{
"key": "value"
}
There is no nice way to convert complex objects to Strings that could be used as a key in the same way, so we need to find another way to express the key in a persistable way. One way to do it, would be to convert the Map in a List which has a tuple as entry. The tuple would then contain the key and the value.
The text was updated successfully, but these errors were encountered:
We are unable to persist Maps which have non primitve types (i.e. their wrapper types) as key. We need a new
BeanConverterExtenstion
that is able to convert and revert Maps of the type Map<Object, Object> in a way that the Objects are converted toPersistentBean
s.We are currently able to persist Map<T, Object> where T is any wrapper of a primitve type. This is done by
MapPrimitiveKeyExtension
. This can be used as a template.https://github.com/ppi-ag/deep-sampler/blob/645e0ab8f4775d194d6c90a54a94cd3e72cf8ca9/deepsampler-persistence/src/main/java/de/ppi/deepsampler/persistence/bean/ext/MapPrimitiveKeyExtension.java
MapPrimitiveKeyExtension
converts the key to a String, so that the key can be used as a property name in JSON:There is no nice way to convert complex objects to Strings that could be used as a key in the same way, so we need to find another way to express the key in a persistable way. One way to do it, would be to convert the Map in a List which has a tuple as entry. The tuple would then contain the key and the value.
The text was updated successfully, but these errors were encountered: