Iterator keyIt = criteria.keySet().iterator();
while (keyIt.hasNext())
{
String key = (String) keyIt.next();
String columnName;
TableMap tableMap = null;
int dotPosition = key.lastIndexOf(".");
if (dotPosition == -1)
{
columnName = key;
tableMap = defaultTableMap;
}
else
{
columnName = key.substring(dotPosition + 1);
String tableName = key.substring(0, dotPosition);
String databaseName = criteria.getDbName();
if (databaseName == null)
{
databaseName = Torque.getDefaultDB();
}
DatabaseMap databaseMap = Torque.getDatabaseMap(databaseName);
if (databaseMap != null)
{
tableMap = databaseMap.getTable(tableName);
}
if (tableMap == null)
{
// try aliases
Map aliases = criteria.getAliases();
if (aliases != null && aliases.get(tableName) != null)
{
tableName = (String) aliases.get(tableName);
tableMap = databaseMap.getTable(tableName);
}
}
if (tableMap == null)
{
// no description of table available, do not modify anything
break;
}
}
ColumnMap columnMap = tableMap.getColumn(columnName);
if (columnMap != null)
{
if ("BOOLEANINT".equals(columnMap.getTorqueType()))
{
Criteria.Criterion criterion = criteria.getCriterion(key);