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

          List searchResults;

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

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

          if (valueObject.getName() != null) {
              if (first) { first = false; }
              sql.append("AND name LIKE '").append(valueObject.getName()).append("%' ");
          }

          if (valueObject.getLocation() != null) {
              if (first) { first = false; }
              sql.append("AND location LIKE '").append(valueObject.getLocation()).append("%' ");
          }

          if (valueObject.getDescription() != null) {
              if (first) { first = false; }
              sql.append("AND description LIKE '").append(valueObject.getDescription()).append("%' ");
          }


          sql.append("ORDER BY bank_branch_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;
    }