java.lang.Object
org.litebridge.orm.engine.RegistrationEngine
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 Summary
ConstructorsConstructorDescriptionRegistrationEngine(TransactionalDatabaseProvider databaseProvider, TableRegistry tableRegistry, TableMapper tableMapper, ChangeTracker changeTracker, MethodHandles.Lookup lookup) Creates a new RegistrationEngine. -
Method Summary
Modifier and TypeMethodDescriptionvoidRegisters annotated entity class(es).voidregister(Class<?> dtoClass, Function<RegistrationContext, RegistrationContextTerminal> rc) Registers a DTO class along with its associated table specification using the provided registration context function.voidregister(DtoTableSpec... dtoTableSpecs) Register a Data Transfer Object (DTO) class(es) with its corresponding table specification(s).
-
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 usetableRegistry- the registry for DTO-to-table mappingstableMapper- the mapper for converting DTO definitions to table definitionschangeTracker- the tracker for monitoring DTO changeslookup- 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
Registers annotated entity class(es).The annotated entity must be annotated with
Tableand contain at least one field annotated withColumn,OneToManyorManyToMany.- Parameters:
entityClasses- the class(es) of the entity/entities to be registered.
-
register
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
-