[odb-users] How to make a "lazy" QList?

Rene Jensen rene at catatonic.dk
Thu Aug 2 14:03:49 EDT 2012


On a more conceptual level, what seems to be the ultimate goal is
> to have the ability to segment data members into lazy-loadable
> sections. Supporting lazy loading for simple members will require
> a separate statement for each member, if we do it member-by-member.
> This is a significant overhead. So grouping members into as few
> sections as possible is a good idea. Maybe something along these
> lines:
>
> class Author
> {
>
>   odb::lazy_section publications;
>
>   #pragma db lazy(publications)
>   QList <QLazySharedPointer<Book> >    authorsBooks;
>
>   #pragma db lazy(publications)
>   vector<QLazySharedPointer<Article> >  authorsArticles;
>
> };
>
> if (!A->publications.loaded ())
>   A->publications.load (); // Loads authorsBooks and authorsArticles.
>
> Just some thoughts.
>
> Boris
>


This is an utterly brilliant idea in every conceivable way that I can
immediately think of.
Cheers


More information about the odb-users mailing list