cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank" <faro...@hotmail.com>
Subject Re: Null value for 'ticketId'
Date Wed, 09 May 2007 17:48:11 GMT
Nevermind,

I forgot the
query.setFetchingDataRows(true);

Thanks

Frank

----- Original Message ----- 
From: "Frank" <farocco@hotmail.com>
To: <user@cayenne.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.DataRow@158689a[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



Mime
View raw message