Class ColumnIdentifierGenerator

java.lang.Object
org.litebridge.db.spi.impl.ColumnIdentifierGenerator
Direct Known Subclasses:
OracleColumnIdentifierGenerator

public class ColumnIdentifierGenerator extends Object
The ColumnIdentifierGenerator class provides utilities for generating SQL column identifiers with optional table qualifiers, handling reserved keywords, and creating aliases for columns. This class can be extended to implement database-specific customizations of column identifier generation.
  • Constructor Details

    • ColumnIdentifierGenerator

      public ColumnIdentifierGenerator()
  • Method Details

    • createSelectColumn

      public String createSelectColumn(Column column, Operation operation, ClauseType clause, boolean nested)
      Creates a SQL identifier for a column to be used in a SELECT clause.
      Parameters:
      column - the column for which to create the identifier
      operation - the current database operation
      clause - the SQL clause where the identifier will be used
      nested - whether the column is part of a nested expression
      Returns:
      the generated SQL column identifier
    • createColumnRef

      public String createColumnRef(Column column, Operation operation, ClauseType clause)
      Creates a SQL reference to a column.
      Parameters:
      column - the column to reference
      operation - the current database operation
      clause - the SQL clause where the reference will be used
      Returns:
      the generated SQL column reference
    • quoteIdentifier

      public String quoteIdentifier(String identifier)
      Quotes a SQL identifier if it is a reserved word.
      Parameters:
      identifier - the identifier to potentially quote
      Returns:
      the quoted (if necessary) or original identifier
    • createAliasDeclaration

      public String createAliasDeclaration(String alias)
      Creates a SQL alias declaration.
      Parameters:
      alias - the alias to declare
      Returns:
      the SQL alias declaration (e.g., "AS alias")