Did you enable QueryCache?

On Wed, Nov 19, 2014 at 11:00 AM, Andrew <[email protected]> wrote:

> Hi
> I have one table, "Articles", in db with these columns:
> Id (int)
> Title (varchar(50))
> Article (varchar(8000))
>
> I create a mapping class:
> public class ArticlesMap:ClassMap<Articles>
> {
> Id(x=>x.Id);
> Map(x=>x.Tltle);
> Map(x=>x.Article);
> }
>
> And I read the data:
> var
> list=_session.Query<Articles>().Cacheable().Orderby(t=>t.Title).ToList();
>
> Ok, all works fine (also the cache), but in the first page I show (with
> pagination) all articles, but I show only the Title and I use Id for create
> a link. But nhibernate request also the article column... Is it possibile
> to request only the Id and title?
>
> I test with this mapping:
> public class ArticlesMap:ClassMap<Articles>
> {
> Id(x=>x.Id);
> Map(x=>x.Tltle);
> Map(x=>x.Article).LazyLoad();
> }
>
> Ok, it works fine, but in the second page, when I request detail for this
> article:
> var list=_session.Query<Articles>().Cacheable().Where(t=>t.Id==1).ToList();
>
> And in page I show this column, this information is not cache. Every time
> I request a page, nhibernate execute a new query.
>
> Is there some solution?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/nhusers.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to