*/
public static void doDelete(Criteria criteria, String tableName, Connection con)
throws TorqueException
{
String dbName = criteria.getDbName();
final DatabaseMap dbMap = Torque.getDatabaseMap(dbName);
// This Callback adds all tables to the Table set which
// are referenced from a cascading criteria. As a result, all
// data that is referenced through foreign keys will also be
// deleted.
SQLBuilder.TableCallback tc = new SQLBuilder.TableCallback() {
public void process (Set tables, String key, Criteria crit)
{
if (crit.isCascade())
{
// This steps thru all the columns in the database.
TableMap[] tableMaps = dbMap.getTables();
for (int i = 0; i < tableMaps.length; i++)
{
ColumnMap[] columnMaps = tableMaps[i].getColumns();
for (int j = 0; j < columnMaps.length; j++)