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

Rene Jensen rene at catatonic.dk
Tue Jul 31 10:02:37 EDT 2012


Hi Boris,

The lazy pointers are great for avoiding excessive loading of data in the
case of foreign keys.

Do you have any plans for making a similar way to postpone loading of
many-to-many keys and arrays?
I realize that it would be a somewhat odd construction. Dreaming something
up...

  class Author
  { ...
    QLazyList<QLazySharedPointer<Book> >    authorsBooks;
    ...
  }

Author* A = ...
A->authorsBooks.isLoaded() // false
A->authorsBooks.load()

A->authorsBooks.size() // 34
A->authorsBooks[10].load()


... etc ...

Just a suggestion. I can see that I have a lot of db bandwidth trying to
load a nested set of classes even though I typically won't need the full
list immediately.

Best regards,
Rene Jensen


More information about the odb-users mailing list