public static CommandData GenerateHqlQuery(QueryModel queryModel)
        {
            var visitor = new SqlGeneratorQueryModelVisitor();

            visitor.VisitQueryModel(queryModel);
            return(visitor.GetHqlCommand());
        }
        // Executes a query with a collection result.
        public IEnumerable <T> ExecuteCollection <T>(QueryModel queryModel)
        {
            var commandData = SqlGeneratorQueryModelVisitor.GenerateHqlQuery(queryModel);
            var args        = commandData.NamedParameters.Select(n => n.Value).ToArray();
            var res         = Db.SQL <T>(commandData.Statement, args);

            return(res);
        }