java.lang.Object
org.litebridgedb.orm.api.register.RegistrationContext
Registration context for associating a Data Transfer Object (DTO) class with database-related functionality
and specifications.
This class is the first step to configure mappings between a DTO and database tables, and to register additional interfaces that the DTO may implement.
It serves as a builder-like structure for progressively defining the registration configuration.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowInterface(Class<?> dtoInterface) Specifies an additional superinterface of the DTO class that will be recognised by Litebridge relational mapping if used in collections.mapToTable(String tableName) Maps a Data Transfer Object (DTO) class to a specified database table.
-
Constructor Details
-
RegistrationContext
-
-
Method Details
-
allowInterface
Specifies an additional superinterface of the DTO class that will be recognised by Litebridge relational mapping if used in collections.For example, if the DTO class is defined as
class MyDto implements MyInterface, thenallowInterface(MyInterface.class)should be called to ensure that Litebridge can correctly handle collections ofMyInterfaceinstances in related DTOs.- Parameters:
dtoInterface- The additional superinterface to allow- Returns:
- This registration context for method chaining
-
mapToTable
Maps a Data Transfer Object (DTO) class to a specified database table. This method initiates the final stage of the registration process by associating the DTO class with the given table name and any provided DTO interfaces.Following this, the table mapping is complete and the builder proceeds to field/column mappings.
- Parameters:
tableName- The name of the table in the database to which the DTO class should be mapped.- Returns:
- A
RegistrationContextTerminalinstance to finalize the mapping configuration.
-