Class NormalizeNameComponent

java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.contentio.export.sql.NormalizeNameComponent
All Implemented Interfaces:
LogEnabled, Component, Contextualizable

Normalize name component
  • Field Details

  • Constructor Details

  • Method Details

    • contextualize

      public void contextualize(Context context) throws ContextException
      Specified by:
      contextualize in interface Contextualizable
      Throws:
      ContextException
    • normalizedTableName

      protected String normalizedTableName(String prefix, String mappingPolicy, String initialTableName, Connection connection)
      Get the normalized table name
      Parameters:
      prefix - the table name prefix
      mappingPolicy - the mapping policy
      initialTableName - The initial table name
      connection - the connection
      Returns:
      normalized table name
    • normalizedColumnName

      protected String normalizedColumnName(String mappingPolicy, String initialColumnName, String initialTableName, Map<String,Map<String,String>> reservedWords, Connection connection)
      Get the normalized column name
      Parameters:
      mappingPolicy - the mappingPolicy
      initialColumnName - The initial column name
      initialTableName - The initial table name
      reservedWords - the map of reserved words
      connection - the connection
      Returns:
      normalized column name
    • normalizedComment

      protected String normalizedComment(String initialComment, int maxLength, Connection connection)
      Get the normalized comment
      Parameters:
      initialComment - the initial comment
      maxLength - The maximun number of authorized characters
      connection - the connection
      Returns:
      normalized comment
    • escapeValue

      protected String escapeValue(String value, Connection connection)
      Escape column value or comment
      Parameters:
      value - The value or SQL comment
      connection - the connection
      Returns:
      the escaped value
    • getMappingTableNameFromCache

      Get the table name from the cache
      Returns:
      the mapping for table name
    • getMappingTableColumnNameFromCache

      Get the column name from the cache
      Returns:
      the mapping for column name
    • normalizeNameFromPolicy

      protected String normalizeNameFromPolicy(String mappingPolicy, String initialName)
      Normalize the initialName into a name depends on the mapping Policy
      Parameters:
      mappingPolicy - (FULL, CAMELCASE, FIRSTCHAR)
      initialName - the initial table name
      Returns:
      the name changed depends on the mapping Policy