Package org.apache.torque.map

## Class MapHelper

- java.lang.Object
- - org.apache.torque.map.MapHelper

-     public final class MapHelper
      extends Object

  Utility methods for Database, Table and Column Maps.
  Version:
    $Id: MapHelper.java 1839288 2018-08-27 09:48:33Z tv $

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static ColumnMap` | `getColumnMap​(Column column, Criteria criteria)` | Returns the column map for a column.
    `static TableMap` | `getTableMap​(Object possibleColumn, Criteria criteria, TableMap defaultTableMap)` | Returns the table map for a table name.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getTableMap

          public static TableMap getTableMap​(Object possibleColumn,
                                             Criteria criteria,
                                             TableMap defaultTableMap)
                                      throws TorqueException

      Returns the table map for a table name. As aliases and asColumns are resolved, the returned table map need not contain the same table name as the column.
      Parameters:
        `possibleColumn` - the possible column to get the table map for.
        `criteria` - A criteria containing the database name and perhaps aliases for the column and table name, not null.
        `defaultTableMap` - a default table map which is used if the table name cannot be resolved, may be null.
      Returns:
        the table map, or null if possibleColumn does not implement the column interface or if the table name cannot be resolved.
      Throws:
        `TorqueException` - possibly if Torque is not initialized.

    - #### getColumnMap

          public static ColumnMap getColumnMap​(Column column,
                                               Criteria criteria)
                                        throws TorqueException

      Returns the column map for a column. As aliases and asColumns are resolved, the returned column map need not contain the same column name as the column.
      Parameters:
        `column` - the column to get the column map for.
        `criteria` - A criteria containing the database name and perhaps aliases for the column and table name, not null.
      Returns:
        the column map, or null if the column name cannot be resolved.
      Throws:
        `TorqueException` - if Torque is not initialized and criteria's databaseName is null.