Annotation Interface Database


@Documented @Retention(RUNTIME) @Target(TYPE) public @interface Database
Defines a database configuration for the custom ORM framework.

This annotation is used to specify the database name, engine type, and the entities (tables) that belong to this database.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Defines the database engine to be used.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Specifies the name of the database.
    Class<? extends Entity>[]
    Specifies the entity classes that represent tables in this database.
  • Element Details

    • name

      String name
      Specifies the name of the database.

      If left empty, the interface's name will be used as the database name by default.

      Returns:
      The name of the database.
      Default:
      ""
    • engine

      Defines the database engine to be used.

      The database engine determines how data is stored and managed.

      Returns:
      The DatabaseEngine used by the database.
    • tables

      Class<? extends Entity>[] tables
      Specifies the entity classes that represent tables in this database.

      Each class should extend Entity to be recognized as a table.

      Returns:
      An array of entity classes representing database tables.
      Default:
      {}