public List searchMatching(Connection conn, MapAccountCustomer valueObject) throws SQLException {

          List searchResults;

          boolean first = true;
          StringBuffer sql = new StringBuffer("SELECT * FROM map_account_customer WHERE 1=1 ");

          if (valueObject.getMap_id() != 0) {
              if (first) { first = false; }
              sql.append("AND map_id = ").append(valueObject.getMap_id()).append(" ");
          }

          if (valueObject.getAccount_id() != 0) {
              if (first) { first = false; }
              sql.append("AND account_id = ").append(valueObject.getAccount_id()).append(" ");
          }

          if (valueObject.getCustomer_id() != 0) {
              if (first) { first = false; }
              sql.append("AND customer_id = ").append(valueObject.getCustomer_id()).append(" ");
          }


          sql.append("ORDER BY map_id ASC ");

          // Prevent accidential full table results.
          // Use loadAll if all rows must be returned.
          if (first)
               searchResults = new ArrayList();
          else
               searchResults = listQuery(conn, conn.prepareStatement(sql.toString()));

          return searchResults;
    }