java.lang.Object
org.litebridge.orm.persistence.alias.DefaultAliasGenerator
- All Implemented Interfaces:
AliasGenerator
DefaultAliasGenerator is an implementation of
AliasGenerator used for generating unique aliases
for tables and columns in a database schema. It maintains internal mappings to ensure alias uniqueness
across multiple calls.
This class uses an AliasTransformer to apply specific transformation rules to the base alias strings.
The aliases are generated using a combination of base string transformations and integer suffixes for conflicts.
Thread-safety: This class is not thread-safe and should be used in single-threaded contexts unless externally synchronized.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultAliasGenerator(AliasTransformer aliasTransformer) Constructs aDefaultAliasGeneratorwith the specifiedAliasTransformer. -
Method Summary
Modifier and TypeMethodDescriptionaliasColumn(Table ormTable, ColumnMetaData columnMetaData) Generates an aliased column for the specified table and column metadata.aliasTable(OrmTable ormTable) Generates an aliased table for the specified ORM table.
-
Constructor Details
-
DefaultAliasGenerator
Constructs aDefaultAliasGeneratorwith the specifiedAliasTransformer.- Parameters:
aliasTransformer- the transformer to use for creating base aliases
-
-
Method Details
-
aliasTable
Description copied from interface:AliasGeneratorGenerates an aliased table for the specified ORM table.- Specified by:
aliasTablein interfaceAliasGenerator- Parameters:
ormTable- The ORM table.- Returns:
- The aliased table.
-
aliasColumn
Description copied from interface:AliasGeneratorGenerates an aliased column for the specified table and column metadata.- Specified by:
aliasColumnin interfaceAliasGenerator- Parameters:
ormTable- The table.columnMetaData- The column metadata.- Returns:
- The aliased column.
-