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.
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears internal alias maps and usage counts.@Nullable StringcolumnAlias(Column column) newColumnAlias(Column column) newTableAlias(Table table) voidpopScope()voidvoidsetColumnAlias(Column column, String alias) @Nullable StringtableAlias(Table table)
-
Constructor Details
-
DefaultAliasGenerator
public DefaultAliasGenerator()
-
-
Method Details
-
columnAlias
- Specified by:
columnAliasin interfaceAliasGenerator
-
tableAlias
- Specified by:
tableAliasin interfaceAliasGenerator
-
newTableAlias
- Specified by:
newTableAliasin interfaceAliasGenerator
-
newColumnAlias
- Specified by:
newColumnAliasin interfaceAliasGenerator
-
setColumnAlias
- Specified by:
setColumnAliasin interfaceAliasGenerator
-
newAlias
- Specified by:
newAliasin interfaceAliasGenerator
-
pushScope
public void pushScope()- Specified by:
pushScopein interfaceAliasGenerator
-
popScope
public void popScope()- Specified by:
popScopein interfaceAliasGenerator
-
clear
public void clear()Description copied from interface:AliasGeneratorClears internal alias maps and usage counts.- Specified by:
clearin interfaceAliasGenerator
-