Search code examples
javers

How to customize property names in javers


Is there anyway we can customize the property names of an entity?

There is an annotation @TypeName for modifying the class name.

Is there any specific annotation for fields ?


Solution

  • In javers 3.1.0, the @PropertyName annotation can be used to easily customize property names.

    @PropertyName — gives an arbitrary name to a property. When not found, Javers infers a property name from a field or getter name. @PropertyName could be useful when refactoring clases that are already committed to JaversRepository.

    see https://javers.org/documentation/domain-configuration/#supported-annotations