One more thing: the following code works well, that is the limit has
effect:
typedef dbo::collection< dbo::ptr<Test> > TTT;
dbo::Transaction transaction(*session);
TTT ttt = session->query< dbo::ptr<Test> >("select test from test").limit(2);
for (TTT::const_iterator i = ttt.begin(); i != ttt.end(); ++i)
std::cerr << " column1 " << (*i)->col1 << std::endl;
It means, that limit is not handled in dbo::QueryModel::setQuery
function.
Regards,
Gabor
On Thu, 2011-02-24 at 12:43 +0100, Gabor E. Tusnady wrote:
> Dear List,
>
> I try to use WTableView with QueryModel as follows:
>
> ...
> dbo::QueryModel< dbo::ptr<Test> > *model = new dbo::QueryModel<
> dbo::ptr<Test> > ();
> dbo::Query< dbo::ptr<Test> > dboquery = session->query< dbo::ptr<Test>
> >(query).limit(limit);
> model->setQuery( dboquery );
> WTableView *widget = new WTableView( );
> widget->setModel( model );
> ...
>
> While query work well, the limit (and similarly offset) has no effect on
> the resulting Table. I am using the latest git. I tried sqlite, pgsql
> and mysql backend, but got the same results.
>
> Any idea, what is wrong with my code?
>
> Thanks,
> tusi
>
>
>
>
> ------------------------------------------------------------------------------
> Free Software Download: Index, Search & Analyze Logs and other IT data in
> Real-Time with Splunk. Collect, index and harness all the fast moving IT data
> generated by your applications, servers and devices whether physical, virtual
> or in the cloud. Deliver compliance at lower cost and gain new business
> insights. http://p.sf.net/sfu/splunk-dev2dev
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest