Exemplo n.º 1
0
        public override IEnumerable <T> Run(CompositeNode rootnode)
        {
            GenerateQuery(rootnode);
            var ids = LuceneSearchHelper.GetIds(Type, BaseQuery).ToList();

            if (ids.IsEmpty() && !string.IsNullOrEmpty(BaseQuery.ToString()))
            {
                ids.Add(0);
            }
            return(Run(ids));
        }
Exemplo n.º 2
0
        public override IEnumerable <T> Run(CompositeNode rootnode, ref IFutureValue <long> count)
        {
            GenerateQuery(rootnode);
            var ids = LuceneSearchHelper.GetIds(Type, BaseQuery).ToList();

            if (ids.IsEmpty() && !string.IsNullOrEmpty(BaseQuery.ToString()))
            {
                ids.Add(0);
            }

            var hql = "from " + Type.FullName + " _this ";

            if (ids.HasItems())
            {
                hql += " where _this." + Metadata.IdentifierPropertyName + " in (" + string.Join(",", ids) + ")";
            }
            count = new DetachedQuery("select count(*) " + hql).FutureValue <T, long>();
            return(Run(ids));
        }