package com.corej2eepatterns.dao;

// importy

public class CustomerDAO {
  . . .  

  public List findCustomersRL(
      CustomerTO cust, int startAtRow, int howManyRows) 
      throws Exception{
    // tworzenie tekstu wyszukiwania SQL
    String searchSQLString = getSearchSQLString(cust);

    // wykonanie wyszukiwania
    return executeSearch(searchSQLString,    
        StartAtRow, howManyRows);
  }

  private List executeSearch(
      String searchSQLString, int startAtRow,
      int howManyRows)
      throws Exception {

    RowSetWrapperList results = null;
    try {
      RowSet rowSet = getRORowSet(searchSQLString, 
          int startAtRow,
          int howManyRows);

      results = new RowSetWrapperList (rowSet);
    } catch (Exception ex) {
      throw new Exception(ex);
    } 

    return results;
  }

  private String getSearchSQLString(CustomerTO cust) {
    // metody tworzenia zapytania 
    // "SELECT" dla SQL jako tekstu String, ktra mumieszcza
    // niezerowe wartoci z obieku transferowego CustomerTO
    // w elementach WHERE
  }

  . . .

}