cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank" <faro...@hotmail.com>
Subject Re: How do I return a record count?
Date Fri, 23 Mar 2007 15:07:13 GMT
Fetch DataObjects is unchecked.
Does this default to fetch DataRows?

Frank

----- Original Message ----- 
From: "Mike Kienenberger" <mkienenb@gmail.com>
To: <user@cayenne.apache.org>
Sent: Friday, March 23, 2007 11:01 AM
Subject: Re: How do I return a record count?


> Did you set the query to fetch DataRows (Maps) instead of DataObjects
> (Entities)?
> 
> On 3/23/07, Frank <farocco@hotmail.com> wrote:
>> Hello,
>> I have a named query defined as:
>> SELECT COUNT(ticketId) AS cnt FROM tickets
>> WHERE ticketClosed = 0
>>
>> This is not working, how do I get the count returned?
>> NamedQuery query = new NamedQuery("openTicketsQuery");
>> List records = context.performQuery(query).;
>> String cnt = records.get(0).toString();
>>
>> Thanks
>>
>> Frank
>>
>

Mime
View raw message