Annotation Type TypeName


  • @Target(TYPE)
    @Retention(RUNTIME)
    public @interface TypeName
    Gives a persistent and human-readable type name for Entity or ValueObject. This name is used everywhere by JaVers, instead of a fragile, fully-qualified class name.

    Naming types is recommended if you are using JaversRepository. It fosters refactoring of package names and class names.

    Usage example:
    @Entity
    @TypeName("Person")
     class Person {
        @Id
         private int id;
         private String name;
     }
     
    @TypeName works similarly to org.springframework.data.annotation.TypeAlias in Spring Data.

    Important
    All classes with @TypeName should be registered using JaversBuilder.withPackagesToScan(String)
    or javers.packagesToScan Spring Boot starter property.
    Since:
    1.4
    See Also:
    PropertyName, Entity, ValueObject
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String value
      The type name to be used when comparing and persisting
    • Element Detail

      • value

        java.lang.String value
        The type name to be used when comparing and persisting