I had a look at this conversation again. JPA (and hibernate) has support for
setFirstResult and setMaxResult. Do we really need something more
complicated than that?

I can easily add optional support for those two parameters in queries such
as findAll, findByCriteria, findByQuery.

/Patrik



PaloT wrote:
> 
> I couldn't find your api proposal, am I overlooking something?
> 
> Just to be sure about paging. For real enterprise solutions you need
> two types of paging.
> - Where you know number of items
> - Where you don't know number of items
> Second one is important for really BIG tables with complex where
> clauses specially when combination of fields depends on complex
> GUI where you don't know which items get filled and you couldn't prepare
> indexes. For example Oracle can do real optimization with maxResults
> set in query.
> For second case we implemented query in special way that we looked
> only N (usually 2 or 3) pages forward if here is enough records.
> 
> Just for curiousness, we have psychological study which state that users
> can't handle more than 80 records. When it doesn't fit they should
> specify better criteria for search. Fulltext search in database is great
> for such situations.
> 
> Pavel
> 
> 
> On Mon, Nov 24, 2008 at 8:51 AM, Steffen Stundzig
> <steffen.stund...@itemis.de> wrote:
>> Hi pavel,
>>
>> you are absolutely right. If I reflect my last implementation with
>> pagination, so I have todo 2 calls to service interface. First call is
>> something like "select count(*) from ..." to calculate the maxPages and
>> next was "select id,.. from".
>>
>> My API proposalin the other email, is it ok? I misssed something?
>>
>> regards
>>
>> Pavel Tavoda schrieb:
>>> I understand you idea however from practice I know that from service
>>> method you have to return not only result set but also some additional
>>> information for paging. For example total number of pages to show, or
>>> how many next pages is available for paging.
>>>
>>> Pavel
>>>
>>> On Sun, Nov 23, 2008 at 11:02 AM, Steffen Stundzig
>>> <steffen.stund...@itemis.de> wrote:
>>>> Hi,
>>>>
>>>> what i mean is, e.g. on each findAll we could generate two findAll
>>>> methods in services and/or repositories. The first is the current one,
>>>> the second (new) contains 2 additional parameters (int firstResult, int
>>>> maxResults). So we are compatible with older versions.
>>>>
>>>> These parameters could we very simple propagated to the criteria based
>>>> FinderAccessApi-classes with criteria.setMaxResults() and so on.
>>>>
>>>> These feature is generic and should be paramterizable per
>>>> generate.pagination.
>>>>
>>>> I'm implementing it in my local sculptor-generator project and be very
>>>> appreciated if it could be in the main trunk. So the diff between the
>>>> generator branches is a little bit smaller. ;-)
>>>>
>>>> I don't know how we could implement this without hibernate but with
>>>> real
>>>> JPA, but I'm sure it's possible.
>>>>
>>>>
>>>> What do you mean?
>>>>
>>>> regards
>>>>    Steffen...
>>>>
>>>> Patrik Nordwall schrieb:
>>>>> Do you mean that you would like to have support for pagination in the
>>>>> built
>>>>> in queries, such as findAll?
>>>>> If you write your own query (access object) I don't think there is
>>>>> anything
>>>>> stopping you from implementing pagination. You can pass your own (non
>>>>> persistent) objects holding these parameters. Please explain more.
>>>>> /Patrik
>>>>>
>>>>>
>>>>> Steffen Stundzig wrote:
>>>>>> Hi all,
>>>>>>
>>>>>> there are any thoughts about pagination of hibernate queries in
>>>>>> sculptor?
>>>>>>
>>>>>> We could use the criteria or the query api for that, but we need also
>>>>>> propagation of the page parameters such firstResult and MaxResults in
>>>>>> the
>>>>>> Services and Repositories, so clients could use it.
>>>>>>
>>>>>> see
>>>>>> http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/objectstate.html#d0e763
>>>>>> hibernate reference
>>>>>>
>>>>>> regards
>>>>>>
>>>> --
>>>> Steffen Stundzig
>>>>
>>>> Telefon: +49 (0) 341 / 231-0183-401
>>>> Telefax: +49 (0) 341 / 231-0183-411
>>>> Mobil:   +49 (0) 151 / 173-9673-1 (!neu)
>>>>
>>>> http://itemis.de
>>>> steffen.stund...@itemis.de
>>>> https://www.xing.com/profile/Steffen_Stundzig
>>>>
>>>> itemis AG
>>>> Ludwig-Erhard-Straße 51
>>>> 04103 Leipzig
>>>>
>>>> Rechtlicher Hinweis:
>>>>
>>>> Amtsgericht Dortmund, HRB 20621
>>>>
>>>> Vorstand: Wolfgang Neuhaus, Jens Wagener, Dr. Georg Pietrek
>>>>
>>>> Aufsichtsrat: Dr. Burkhard Igel(Vors.), Stephan Grollmann, Michael
>>>> Neuhaus
>>>>
>>>>
>>>> -------------------------------------------------------------------------
>>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>>> challenge
>>>> Build the coolest Linux based applications with Moblin SDK & win great
>>>> prizes
>>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>>> world
>>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>>> _______________________________________________
>>>> Fornax-developer mailing list
>>>> Fornax-developer@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/fornax-developer
>>>>
>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>>> challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great
>>> prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the
>>> world
>>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>>> _______________________________________________
>>> Fornax-developer mailing list
>>> Fornax-developer@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/fornax-developer
>>
>> --
>> Steffen Stundzig
>>
>> Telefon: +49 (0) 341 / 231-0183-401
>> Telefax: +49 (0) 341 / 231-0183-411
>> Mobil:   +49 (0) 151 / 173-9673-1 (!neu)
>>
>> http://itemis.de
>> steffen.stund...@itemis.de
>> https://www.xing.com/profile/Steffen_Stundzig
>>
>> itemis AG
>> Ludwig-Erhard-Straße 51
>> 04103 Leipzig
>>
>> Rechtlicher Hinweis:
>>
>> Amtsgericht Dortmund, HRB 20621
>>
>> Vorstand: Wolfgang Neuhaus, Jens Wagener, Dr. Georg Pietrek
>>
>> Aufsichtsrat: Dr. Burkhard Igel(Vors.), Stephan Grollmann, Michael
>> Neuhaus
>>
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
>> world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Fornax-developer mailing list
>> Fornax-developer@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/fornax-developer
>>
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Fornax-developer mailing list
> Fornax-developer@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fornax-developer
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-sculptor--pagination-tp20636538s17564p25846513.html
Sent from the Fornax-Platform mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Fornax-developer mailing list
Fornax-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fornax-developer

Reply via email to