cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From felix <felix.serr...@technicalnorms.com>
Subject Re: paginated queries, setPageSize
Date Tue, 05 Apr 2011 15:06:39 GMT
 Hi Andrey,

 Thanks for the response.
 You are right, it's the new Arraylist what is causing that behaviour.
 The reason to do that was that SimpleIdIncrementalFaultList is not 
 serializable and Wicket components require it.

 Im trying to figure a way around this, maybe Cayenne's pagination cant 
 be used transparently with Wicket and I'll have
 to query the page rows manually.



 On Tue, 5 Apr 2011 07:02:01 -0700 (PDT), "Andrey Razumovsky [via 
 Cayenne]" <ml-node+2780019-1603816306-389056@n3.nabble.com> wrote:
> Hi Felix,
>
> I believe this is happenning when you're doing a copy from
> query-returned List to new ArrayList. It iterates though original
> list
> and every get(i) causes a new query. Is there a strong reason you
> need
> to do this?
>
> 2011/4/5 felix :
>
>> Hi,
>>
>> I have integrated cayenne with a web framework (wicket) and
> pagination is
>> crucial for the project we are implementing, however it doesnt seem
> to work,
>> and im not sure whether im doing something wrong or I dont not
> understand
>> the concept
>>
>> (there are 1004 'Proposal' objects in the database)
>>
>> When I do:
>> -------------
>>                SelectQuery q = new
> SelectQuery(Proposal.class);
>>                q.setPageSize(50);
>>
>>                //FS: Casting WicketNotSerializableException
> with
>> SimpleIdIncrementalFaultList(cayenne return class)
>>                queryRows = new
> ArrayList(MCApplication.getContext().performQuery(q));
>> --------------
>> I expected Cayenne to get all the IDs and the first 50 objects (1st
> page),
>> however it seems it is fetching the 1004 objects. The log is the
> following:
>>
>>
>> INFO  - QueryLogger                - --- will run 1 query.
>
>> INFO  - QueryLogger                - --- transaction
> started.
>> INFO  - QueryLogger                - SELECT t0.ProposalID
> FROM Proposal t0
>> INFO  - QueryLogger                - === returned 1006
> rows. - took 10 ms.
>> INFO  - QueryLogger                - +++ transaction
> committed.
>> INFO  - QueryLogger                - --- will run 1 query.
>
>> INFO  - QueryLogger                - --- transaction
> started.
>> INFO  - QueryLogger                - SELECT t0.ProposalID,
> t0.ProposalTS,
>> t0.CompanyFK, t0 FROM Proposal t0 WHERE (t0.ProposalID = ?) OR
>> (t0.ProposalID = ?)............... - prepared in 30 ms.
>> INFO  - QueryLogger                - === returned 1006
> rows. - took 130 ms.
>> INFO  - QueryLogger                - +++ transaction
> committed.
>>
>> I'd appreciate if someone could help me out.
>>
>> Thanks
>> Felix
>>
>> --
>> View this message in context:
> 
> http://cayenne.195.n3.nabble.com/paginated-queries-setPageSize-tp2779985p2779985.html
> [2]
>> Sent from the Cayenne - User mailing list archive at Nabble.com.
>
> --
> Andrey
>
> -------------------------
>
> If you reply to this email, your message will be added to the
> discussion below:
> 
> http://cayenne.195.n3.nabble.com/paginated-queries-setPageSize-tp2779985p2780019.html
> [3]
>  To unsubscribe from paginated queries, setPageSize, click here [4].
>
> Links:
> ------
> [1]
> 
> http://control.intraza.com/user/SendEmail.jtp?type=node&node=2780019&i=0&by-user=t
> [2]
> 
> http://cayenne.195.n3.nabble.com/paginated-queries-setPageSize-tp2779985p2779985.html?by-user=t
> [3]
> 
> http://cayenne.195.n3.nabble.com/paginated-queries-setPageSize-tp2779985p2780019.html
> [4]
> 
> http://cayenne.195.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2779985&code=ZmVsaXguc2VycmFub0B0ZWNobmljYWxub3Jtcy5jb218Mjc3OTk4NXwtMjEyNzM3Njk3OQ==



--
View this message in context: http://cayenne.195.n3.nabble.com/paginated-queries-setPageSize-tp2779985p2780249.html
Sent from the Cayenne - User mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message