Re: Null value for 'ticketId'

From: Frank (farocc..otmail.com)
Date: Wed May 09 2007 - 13:48:11 EDT

  • Next message: Alejandro Daniel Toffetti: "Re: Error: Parameter #1 has not been set"

    Nevermind,

    I forgot the
    query.setFetchingDataRows(true);

    Thanks

    Frank

    ----- Original Message -----
    From: "Frank" <farocc..otmail.com>
    To: <use..ayenne.apache.org>
    Sent: Wednesday, May 09, 2007 1:41 PM
    Subject: Null value for 'ticketId'

    Hello,

    I am trying to get a count of records from mysql.
    I keep getting this error.

    Null value for 'ticketId'. Snapshot:
    org.objectstyle.cayenne.DataRo..58689a[values={COUNT(*)=5},
    version=-9223372036854775802, replaces=-9223372036854775808]. Prefix: null

    here is my code:

         String sql = "SELECT COUNT(*) AS cnt FROM tickets";
         SQLTemplate query = new SQLTemplate(tickets.class, sql);
         List list = context.performQuery(query);
         Map row = (Map)list.get(0);
         String cnt = row.get("cnt").toString();

    Thanks

    Frank



    This archive was generated by hypermail 2.0.0 : Wed May 09 2007 - 13:48:51 EDT