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 using hypersistence-utils in our applications, but we are not using the hibernate.properties explicitly. Instead, we are customizing the object mapper via Spring @Configuration, extending HibernatePropertiesCustomizer.
It would be very useful if we do not have to depend on string changes on both sides, I mean, if in the future you decide to change hypersistence.utils.jackson.object.mapper property name to something else, developers would also have to change it.
I would like to suggest exposing those properties as enums.
The text was updated successfully, but these errors were encountered:
Even if an Enum is used, if a property name will change, it's Enum name will change as well.
The properties are already exposed as constants you can reference programmatically, so you don't need to use the String values in the Java based Spring configuration.
Thanks for your quick answer. I understand your point regarding to the Enum name.
But I can't see how the properties are exposed as constants. For example:
public enum PropertyKey {
JACKSON_OBJECT_MAPPER(
"hypersistence.utils.jackson.object.mapper",
"hibernate.types.jackson.object.mapper"
)
hypersistence.utils.jackson.object.mapper is plain string, a private key from PropertyKey.JACKSON_OBJECT_MAPPER. If at least it was like Configuration.PROPERTIES_FILE_PATH, we could access it instead of hardcording a string.
Yes, that's right. I was under the impression that it's possible to use the PropertyKey directly when passing the settings, but that's not currently possible.
If you this it's useful, you could try to provide a Pull Request that adds support for this feature.
We are using
hypersistence-utils
in our applications, but we are not using thehibernate.properties
explicitly. Instead, we are customizing the object mapper via Spring@Configuration
, extendingHibernatePropertiesCustomizer
.It would be very useful if we do not have to depend on string changes on both sides, I mean, if in the future you decide to change
hypersistence.utils.jackson.object.mapper
property name to something else, developers would also have to change it.I would like to suggest exposing those properties as enums.
The text was updated successfully, but these errors were encountered: