Class RegistrationEngine

java.lang.Object
org.litebridge.orm.engine.RegistrationEngine

public class RegistrationEngine extends Object
The RegistrationEngine class handles the registration of data transfer objects (DTOs) and their corresponding table specifications to enable mapping between application entities and database tables.

This class supports various registration methods for defining table structures, relationships, and metadata for database operations.

  • Constructor Details

    • RegistrationEngine

      public RegistrationEngine(TransactionalDatabaseProvider databaseProvider, TableRegistry tableRegistry, TableMapper tableMapper, ChangeTracker changeTracker, MethodHandles.Lookup lookup)
      Creates a new RegistrationEngine.
      Parameters:
      databaseProvider - the database provider to use
      tableRegistry - the registry for DTO-to-table mappings
      tableMapper - the mapper for converting DTO definitions to table definitions
      changeTracker - the tracker for monitoring DTO changes
      lookup - the lookup for accessing DTO fields
  • Method Details

    • register

      public void register(Class<?> dtoClass, Function<RegistrationContext,RegistrationContextTerminal> rc)
      Registers a DTO class along with its associated table specification using the provided registration context function.
      Parameters:
      dtoClass - The class object of the DTO (Data Transfer Object) to be registered.
      rc - A function that takes a RegistrationContext instance to configure the table mapping.
    • register

      public void register(Class<?>... entityClasses)
      Registers annotated entity class(es).

      The annotated entity must be annotated with Table and contain at least one field annotated with Column, OneToMany or ManyToMany.

      Parameters:
      entityClasses - the class(es) of the entity/entities to be registered.
    • register

      public void register(DtoTableSpec... dtoTableSpecs)
      Register a Data Transfer Object (DTO) class(es) with its corresponding table specification(s).

      This method maps the DTO class to a database table and stores the association in the table registry to enable database operations such as insert, update, or query.

      Parameters:
      dtoTableSpecs - One or more DTO-to-table mapping details