Annotation Interface Metamodel


@Retention(RUNTIME) public @interface Metamodel
Indicates a metamodel class that provides type-safe access to entity properties.

Metamodel classes enable compile-time type checking when referencing entity properties in criteria queries and other database operations.

For example, the name of the metamodel is "MyEmployeeMetamodel" when you specify the prefix and the suffix as follows:

 @Entity(metamodel = @Metamodel(prefix = "My", suffix="Metamodel")
 public class Employee {
     ...
 }
 

If both the prefix and the suffix are empty, the values of the following annotation processing options are used:

  • doma.metamodel.prefix
  • doma.metamodel.suffix
  • Element Details

    • prefix

      String prefix
      Returns:
      the prefix for the metamodel class
      Default:
      ""
    • suffix

      String suffix
      Returns:
      the suffix for the metamodel class
      Default:
      ""
    • scopes

      Class<?>[] scopes
      Returns:
      the array of scope classes that define the visibility boundaries for this metamodel
      Default:
      {}