0 Replies Latest reply on Sep 23, 2005 8:38 AM by dornus

    Lazy Loading for columns?

    dornus Novice

      I was wondering if lazy loading could be done for indivdual columns, or if I would have to use a native query to achieve what I want.

      Let's say you have a table in the database for storing blogs.
      Something like
      blogEditor int
      blogHeader varchar
      blogContents text
      blogCreated Datetime

      You display the headers of all blogs to the user. Each display page has prev and next links, and displays 50 blog headers per page. When a user clicks on a blog header, it will display the contents of the blog.

      Obviously I do not want to pre-load 50 blogs at a time, especially since they can contain lots of data, and also because the user may only end up viewing 1 or 2 blogs from the list.

      Now, if I use the default Entity behaviour, it will load all 50 blogs at a time in its entirety. I would like to perform lazy loading by loading all the data from the blog table except for the blog contents (which could contain lots of data). The blog comments column should only be loaded if the user requests to view it.

      Is there an annotation I could use to achieve this, or do I have to write a native query?

      Thanks