/**
   * Grabs the raw Village records to be formed into objects. This method should be used for
   * transactions
   *
   * @param con the connection to use
   * @throws TorqueException Any exceptions caught during processing will be rethrown wrapped into a
   *     TorqueException.
   */
  public static List doSelectVillageRecords(Criteria criteria, Connection con)
      throws TorqueException {
    if (criteria.getSelectColumns().size() == 0) {
      addSelectColumns(criteria);
    }

    // Set the correct dbName if it has not been overridden
    // criteria.getDbName will return the same object if not set to
    // another value so == check is okay and faster
    if (criteria.getDbName() == Torque.getDefaultDB()) {
      criteria.setDbName(DATABASE_NAME);
    }
    // BasePeer returns a List of Value (Village) arrays.  The array
    // order follows the order columns were placed in the Select clause.
    if (con == null) {
      return BasePeer.doSelect(criteria);
    } else {
      return BasePeer.doSelect(criteria, con);
    }
  }