You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by John Seer <pu...@yahoo.com> on 2009/07/25 00:39:03 UTC

Pagination by objects

Hello,

I am using in one of my projects ibatis and have a problem with pagination.

For example I want to select 100 objects at a time and skip first 100 of
them. I didn't find any good way of doing it and nothing exciting about
scrolling too.


Any suggestion how to achieve/solve my problem?


Thanks
John

-- 
View this message in context: http://www.nabble.com/Pagination-by-objects-tp24652955p24652955.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Re: Pagination by objects

Posted by John Seer <pu...@yahoo.com>.
The heck I am talking about is that this shit doesn't work for me



Larry Meadors wrote:
> 
> I'll put this as nicely as I can: What the heck are you talking about?
> 
> Larry
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
> 
> 
> 



-- 
View this message in context: http://www.nabble.com/Pagination-by-objects-tp24652955p24685867.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Re: Pagination by objects

Posted by Sundar Sankar <fa...@gmail.com>.
or you could select * from (select rownum as ro, * from XXXView) where ro
between 1 and 1000.

If you had rownum as part of your view, I guess you could use that as the ID
and Ibatis queryForList might work too.

On Mon, Jul 27, 2009 at 11:30 AM, Clinton Begin <cl...@gmail.com>wrote:

> Larry,
> He's doing a join, so each result object is made up of possibly many rows.
>  So simply skipping arbitrary rows will create incomplete objects.
>
> Clinton
>
>
> On Mon, Jul 27, 2009 at 12:12 PM, Larry Meadors <la...@gmail.com>wrote:
>
>> I'll put this as nicely as I can: What the heck are you talking about?
>>
>> Larry
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
>> For additional commands, e-mail: user-java-help@ibatis.apache.org
>>
>>
>


-- 
Regards
Sundar S.

Re: Pagination by objects

Posted by Clinton Begin <cl...@gmail.com>.
Larry,
He's doing a join, so each result object is made up of possibly many rows.
 So simply skipping arbitrary rows will create incomplete objects.

Clinton

On Mon, Jul 27, 2009 at 12:12 PM, Larry Meadors <la...@gmail.com>wrote:

> I'll put this as nicely as I can: What the heck are you talking about?
>
> Larry
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>

Re: Pagination by objects

Posted by Larry Meadors <la...@gmail.com>.
I'll put this as nicely as I can: What the heck are you talking about?

Larry

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Re: Pagination by objects

Posted by John Seer <pu...@yahoo.com>.
Thanks Clinton, 
I was thinking doing it with IN, but I thinking creating temp table with ids
and doing pagination on it will work faster




Clinton Begin wrote:
> 
> Ah, I know what you're talking about.
> There's no way to solve that, other than to load less data, or load each
> object up separately.  If I'm not mistaken, not even a full ORM will be
> able
> to do that without first building the entire map of keyed relationships.
> 
> For example, an ORM could look up all of the unique primary key values,
> select the first 1000 out of 200,000, then generate an IN clause and add
> it
> to the join.
> 
> You could do the same with iBATIS, but you have to do it manually.
> 
> Clinton
> 
> On Mon, Jul 27, 2009 at 12:00 PM, John Seer <pu...@yahoo.com> wrote:
> 
>>
>> >>You could start with the documentation...or even just your IDE code
>> >>completion... :-)
>>
>> >>Look up the queryForList  method signatures..
>>
>> queryForList  is taking start row number and end row number.
>> For example if I have temp table with 200k rows which was build using
>> left
>> joins, and if I will ask return from 0, 1000 it will return 6 Objects the
>> 6th object will not be complete because the rest of the data is in rows
>> from
>> 1001-1300
>>
>> Example of the table
>>
>> ROW   ID A    B     C  D  E F
>> 1        1  null null  0  0  0 0
>> 2        1  null null  0  0  0 1
>> 3        1  null null  0  0  1 0
>> 4        1  null null  0  0  1 1
>> 5        1  null null  0  1  0 0
>> 6        1  null null  0  1  0 1
>> 7        1  null null  0  1  1 0
>> 8        1  null null  1  1  0 0
>> 9        2  null null  0  0  0 0
>> 10      2  null null  0  0  0 1
>> 11      2  null null  0  0  1 0
>> 12      2  null null  0  0  1 1
>> 13      2  null null  0  1  0 0
>> 14      2  null null  0  1  0 1
>> 15      2  null null  0  1  1 0
>> 16      2  null null  1  1  0 0
>>
>> If I will ask to get from
>> queryForList("get", 0,10)
>>
>> I will get 2 Objects but second object will not be complete
>>
>>
>>
>> Clinton Begin wrote:
>> >
>> > You could start with the documentation...or even just your IDE code
>> > completion... :-)
>> >
>> > Look up the queryForList  method signatures..
>> >
>> > Clinton
>> >
>> > On Fri, Jul 24, 2009 at 4:39 PM, John Seer <pu...@yahoo.com> wrote:
>> >
>> >>
>> >> Hello,
>> >>
>> >> I am using in one of my projects ibatis and have a problem with
>> >> pagination.
>> >>
>> >> For example I want to select 100 objects at a time and skip first 100
>> of
>> >> them. I didn't find any good way of doing it and nothing exciting
>> about
>> >> scrolling too.
>> >>
>> >>
>> >> Any suggestion how to achieve/solve my problem?
>> >>
>> >>
>> >> Thanks
>> >> John
>> >>
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/Pagination-by-objects-tp24652955p24652955.html
>> >> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
>> >> For additional commands, e-mail: user-java-help@ibatis.apache.org
>> >>
>> >>
>> >
>> >
>>
>> The
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Pagination-by-objects-tp24652955p24685472.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
>> For additional commands, e-mail: user-java-help@ibatis.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Pagination-by-objects-tp24652955p24686187.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Re: Pagination by objects

Posted by John Seer <pu...@yahoo.com>.
Thanks Clinton, 
I was thinking doing it with IN, but I thinking creating temp table with ids
and doing pagination on it will work faster




Clinton Begin wrote:
> 
> Ah, I know what you're talking about.
> There's no way to solve that, other than to load less data, or load each
> object up separately.  If I'm not mistaken, not even a full ORM will be
> able
> to do that without first building the entire map of keyed relationships.
> 
> For example, an ORM could look up all of the unique primary key values,
> select the first 1000 out of 200,000, then generate an IN clause and add
> it
> to the join.
> 
> You could do the same with iBATIS, but you have to do it manually.
> 
> Clinton
> 
> On Mon, Jul 27, 2009 at 12:00 PM, John Seer <pu...@yahoo.com> wrote:
> 
>>
>> >>You could start with the documentation...or even just your IDE code
>> >>completion... :-)
>>
>> >>Look up the queryForList  method signatures..
>>
>> queryForList  is taking start row number and end row number.
>> For example if I have temp table with 200k rows which was build using
>> left
>> joins, and if I will ask return from 0, 1000 it will return 6 Objects the
>> 6th object will not be complete because the rest of the data is in rows
>> from
>> 1001-1300
>>
>> Example of the table
>>
>> ROW   ID A    B     C  D  E F
>> 1        1  null null  0  0  0 0
>> 2        1  null null  0  0  0 1
>> 3        1  null null  0  0  1 0
>> 4        1  null null  0  0  1 1
>> 5        1  null null  0  1  0 0
>> 6        1  null null  0  1  0 1
>> 7        1  null null  0  1  1 0
>> 8        1  null null  1  1  0 0
>> 9        2  null null  0  0  0 0
>> 10      2  null null  0  0  0 1
>> 11      2  null null  0  0  1 0
>> 12      2  null null  0  0  1 1
>> 13      2  null null  0  1  0 0
>> 14      2  null null  0  1  0 1
>> 15      2  null null  0  1  1 0
>> 16      2  null null  1  1  0 0
>>
>> If I will ask to get from
>> queryForList("get", 0,10)
>>
>> I will get 2 Objects but second object will not be complete
>>
>>
>>
>> Clinton Begin wrote:
>> >
>> > You could start with the documentation...or even just your IDE code
>> > completion... :-)
>> >
>> > Look up the queryForList  method signatures..
>> >
>> > Clinton
>> >
>> > On Fri, Jul 24, 2009 at 4:39 PM, John Seer <pu...@yahoo.com> wrote:
>> >
>> >>
>> >> Hello,
>> >>
>> >> I am using in one of my projects ibatis and have a problem with
>> >> pagination.
>> >>
>> >> For example I want to select 100 objects at a time and skip first 100
>> of
>> >> them. I didn't find any good way of doing it and nothing exciting
>> about
>> >> scrolling too.
>> >>
>> >>
>> >> Any suggestion how to achieve/solve my problem?
>> >>
>> >>
>> >> Thanks
>> >> John
>> >>
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/Pagination-by-objects-tp24652955p24652955.html
>> >> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
>> >> For additional commands, e-mail: user-java-help@ibatis.apache.org
>> >>
>> >>
>> >
>> >
>>
>> The
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Pagination-by-objects-tp24652955p24685472.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
>> For additional commands, e-mail: user-java-help@ibatis.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Pagination-by-objects-tp24652955p24686185.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Re: Pagination by objects

Posted by Clinton Begin <cl...@gmail.com>.
Ah, I know what you're talking about.
There's no way to solve that, other than to load less data, or load each
object up separately.  If I'm not mistaken, not even a full ORM will be able
to do that without first building the entire map of keyed relationships.

For example, an ORM could look up all of the unique primary key values,
select the first 1000 out of 200,000, then generate an IN clause and add it
to the join.

You could do the same with iBATIS, but you have to do it manually.

Clinton

On Mon, Jul 27, 2009 at 12:00 PM, John Seer <pu...@yahoo.com> wrote:

>
> >>You could start with the documentation...or even just your IDE code
> >>completion... :-)
>
> >>Look up the queryForList  method signatures..
>
> queryForList  is taking start row number and end row number.
> For example if I have temp table with 200k rows which was build using left
> joins, and if I will ask return from 0, 1000 it will return 6 Objects the
> 6th object will not be complete because the rest of the data is in rows
> from
> 1001-1300
>
> Example of the table
>
> ROW   ID A    B     C  D  E F
> 1        1  null null  0  0  0 0
> 2        1  null null  0  0  0 1
> 3        1  null null  0  0  1 0
> 4        1  null null  0  0  1 1
> 5        1  null null  0  1  0 0
> 6        1  null null  0  1  0 1
> 7        1  null null  0  1  1 0
> 8        1  null null  1  1  0 0
> 9        2  null null  0  0  0 0
> 10      2  null null  0  0  0 1
> 11      2  null null  0  0  1 0
> 12      2  null null  0  0  1 1
> 13      2  null null  0  1  0 0
> 14      2  null null  0  1  0 1
> 15      2  null null  0  1  1 0
> 16      2  null null  1  1  0 0
>
> If I will ask to get from
> queryForList("get", 0,10)
>
> I will get 2 Objects but second object will not be complete
>
>
>
> Clinton Begin wrote:
> >
> > You could start with the documentation...or even just your IDE code
> > completion... :-)
> >
> > Look up the queryForList  method signatures..
> >
> > Clinton
> >
> > On Fri, Jul 24, 2009 at 4:39 PM, John Seer <pu...@yahoo.com> wrote:
> >
> >>
> >> Hello,
> >>
> >> I am using in one of my projects ibatis and have a problem with
> >> pagination.
> >>
> >> For example I want to select 100 objects at a time and skip first 100 of
> >> them. I didn't find any good way of doing it and nothing exciting about
> >> scrolling too.
> >>
> >>
> >> Any suggestion how to achieve/solve my problem?
> >>
> >>
> >> Thanks
> >> John
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Pagination-by-objects-tp24652955p24652955.html
> >> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> >> For additional commands, e-mail: user-java-help@ibatis.apache.org
> >>
> >>
> >
> >
>
> The
>
> --
> View this message in context:
> http://www.nabble.com/Pagination-by-objects-tp24652955p24685472.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>

Re: Pagination by objects

Posted by John Seer <pu...@yahoo.com>.
>>You could start with the documentation...or even just your IDE code
>>completion... :-)

>>Look up the queryForList  method signatures..

queryForList  is taking start row number and end row number. 
For example if I have temp table with 200k rows which was build using left
joins, and if I will ask return from 0, 1000 it will return 6 Objects the
6th object will not be complete because the rest of the data is in rows from
1001-1300

Example of the table

ROW   ID A    B     C  D  E F
1        1  null null  0  0  0 0
2        1  null null  0  0  0 1
3        1  null null  0  0  1 0
4        1  null null  0  0  1 1
5        1  null null  0  1  0 0
6        1  null null  0  1  0 1
7        1  null null  0  1  1 0
8        1  null null  1  1  0 0
9        2  null null  0  0  0 0
10      2  null null  0  0  0 1
11      2  null null  0  0  1 0
12      2  null null  0  0  1 1
13      2  null null  0  1  0 0
14      2  null null  0  1  0 1
15      2  null null  0  1  1 0
16      2  null null  1  1  0 0

If I will ask to get from
queryForList("get", 0,10)

I will get 2 Objects but second object will not be complete 



Clinton Begin wrote:
> 
> You could start with the documentation...or even just your IDE code
> completion... :-)
> 
> Look up the queryForList  method signatures..
> 
> Clinton
> 
> On Fri, Jul 24, 2009 at 4:39 PM, John Seer <pu...@yahoo.com> wrote:
> 
>>
>> Hello,
>>
>> I am using in one of my projects ibatis and have a problem with
>> pagination.
>>
>> For example I want to select 100 objects at a time and skip first 100 of
>> them. I didn't find any good way of doing it and nothing exciting about
>> scrolling too.
>>
>>
>> Any suggestion how to achieve/solve my problem?
>>
>>
>> Thanks
>> John
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Pagination-by-objects-tp24652955p24652955.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
>> For additional commands, e-mail: user-java-help@ibatis.apache.org
>>
>>
> 
> 

The 

-- 
View this message in context: http://www.nabble.com/Pagination-by-objects-tp24652955p24685472.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Re: Pagination by objects

Posted by Clinton Begin <cl...@gmail.com>.
You could start with the documentation...or even just your IDE code
completion... :-)

Look up the queryForList  method signatures..

Clinton

On Fri, Jul 24, 2009 at 4:39 PM, John Seer <pu...@yahoo.com> wrote:

>
> Hello,
>
> I am using in one of my projects ibatis and have a problem with pagination.
>
> For example I want to select 100 objects at a time and skip first 100 of
> them. I didn't find any good way of doing it and nothing exciting about
> scrolling too.
>
>
> Any suggestion how to achieve/solve my problem?
>
>
> Thanks
> John
>
> --
> View this message in context:
> http://www.nabble.com/Pagination-by-objects-tp24652955p24652955.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>