Package org.datanucleus.store.rdbms.sql
Class SQLTableAlphaNamer
- java.lang.Object
-
- org.datanucleus.store.rdbms.sql.SQLTableAlphaNamer
-
- All Implemented Interfaces:
SQLTableNamer
public class SQLTableAlphaNamer extends java.lang.Object implements SQLTableNamer
SQLTable namer that generates names like A0, B1, C0, ... , Z0, AA0, AB0, ... etc. Tables are prefixed by a letter based on the table-group they are in, followed by a number being the number within that table-group. The candidate table-group will always be prefixed A when not predefined (i.e for JDOQL). Should handle up to 26x27 combinations (i.e 702). Anyone needing more than that has serious problems, as does their RDBMS.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.String[]
CHARS
-
Constructor Summary
Constructors Constructor Description SQLTableAlphaNamer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAliasForTable(SQLStatement stmt, Table table, java.lang.String groupName)
Method to return the alias to use for the specified table.private java.lang.String
getLettersForNumber(int number)
-
-
-
Method Detail
-
getAliasForTable
public java.lang.String getAliasForTable(SQLStatement stmt, Table table, java.lang.String groupName)
Description copied from interface:SQLTableNamer
Method to return the alias to use for the specified table.- Specified by:
getAliasForTable
in interfaceSQLTableNamer
- Parameters:
stmt
- The statement where we will use the tabletable
- The tablegroupName
- Name of the table group- Returns:
- The alias to use
-
getLettersForNumber
private java.lang.String getLettersForNumber(int number)
-
-