public PaginableDynQuery(DetachedDynQuery query)
        {
            if (query == null)
            {
                throw new ArgumentNullException("query");
            }

            this.query = query;
        }
        public void ToRowCount()
        {
            Select s = new Select("f.Name, f.Description, b.Descriptoin").From("Foo f join f.Bar b");
            Where where = new Where();
            where.And("f.Name like :pName");
            where.And("b.Asociated > :pAso");
            s.From().SetWhere(where);
            OrderBy order = new OrderBy().Add("b.Asociated", true);
            order.Add("f.Name");
            s.From().SetOrderBy(order);

            DetachedDynQuery ddq = new DetachedDynQuery(s);
            DetachedQuery drc = (DetachedQuery) ddq.TransformToRowCount();
            Assert.AreEqual(
                "select count(*) from Foo f join f.Bar b where ((f.Name like :pName) and (b.Asociated > :pAso))",
                drc.Hql);
        }