Re: Result set

From: Sami Mohammed (SMOHAMME..ndependenthealth.com)
Date: Tue Mar 15 2005 - 09:16:15 EST

  • Next message: Fredrik Liden: "RE: Storing a copy of a DataObject in the session"

    Hi Tore

    Thank you.
    I am wondering why we use ResultIterator in cayenne.
    your code is working fine

    sami

    CONFIDENTIALITY NOTICE. This e-mail and attachments, if any, may contain confidential information which is privileged and protected from disclosure by Federal and State
    confidentiality laws rules and regulations. This e-mail and attachments, if any, are intended for the designated addressee only. If you are not the designated addressee, you
    are hereby notified that any disclosure, copying, or distribution of this e-mail and its attachments, if any, may be unlawful and may subject you to legal consequences. If you
    have received this e-mail and attachments in error, please contact Independent Health immediately at (716) 631-3001 and delete the e-mail and its attachments from your
    computer. Thank you for your attention

    >>> halse..vv.ntnu.no 03/15/05 03:37AM >>>
    On Mar 14, 2005, at 22:02, Sami Mohammed wrote:

    > while (rs.next()) --->HOW TO CONVERT THE FOLLOWING CODE
    > IN CAYENNE, or iterate
    > {
    > String tableName = rs.getString("TABLE_NAME");
    > vMappingNames.add(new TableLableValueBean(tableName, tableName));
    > }

    Are "TABLE_NAME" a column in your query or is it the name of the actual
    table you are querying? I think this should be ok:
    List resultList = context...
    Iterator it = resultList.iterator();
    while(it.hasNext){
      Cw_Table t = (Cw_Table)it.next();
      String tableName = t.getTableName(); // method name depend on your
    mapping
      vMappingNames...
    }

      - Tore.



    This archive was generated by hypermail 2.0.0 : Tue Mar 15 2005 - 14:18:10 EST