expose ObjectMapper of the BaseJsonModel so that other framework related components get access to a fully configured object mapper that knows about all the subclasses of the BaseJsonModel

This commit is contained in:
Dmitry Toptygin
2021-01-28 11:34:23 -05:00
parent 71cf6b6156
commit ed6421865d

View File

@@ -89,6 +89,11 @@ public abstract class BaseJsonModel implements Cloneable, Serializable {
PRETTY_WRITTER = MAPPER.writer().withDefaultPrettyPrinter();
}
public static ObjectMapper getMapper() {
return MAPPER;
}
/**
* For NoSQL databases we do not use synthetic keys, but they are still part of the object model.
* This method allows us to calculate a value of synthetic key from two long elements, for example equipmentId and timestamp.