org.apache.torque.map
Class MapHelper

java.lang.Object
  extended by org.apache.torque.map.MapHelper

public final class MapHelper
extends Object

Utility methods for Database, Table and Column Maps.

Version:
$Id: MapHelper.java 1448414 2013-02-20 21:06:35Z tfischer $

Method Summary
static ColumnMap getColumnMap(Column column, CriteriaInterface<?> criteria)
          Returns the column map for a column.
static TableMap getTableMap(Object possibleColumn, CriteriaInterface<?> 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,
                                   CriteriaInterface<?> 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,
                                     CriteriaInterface<?> 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.


Copyright © 2000-2013 The Apache Software Foundation. All Rights Reserved.