Ejemplo n.º 1
0
        ///////////////////////
        // Static Functions

        private static object[] CreateRecordKey(HqlRecord record, HqlOrderBy order, HqlClause group, HqlClause output, int linenum)
        {
            int orderlength  = order.Count;
            int grouplength  = (group.Count == 0) ? 1: group.Count;
            int outputlength = ((output == null) ? 0 : output.Count);

            int length = orderlength + grouplength + outputlength;

            object[] keys = new object[length];

            object[] orderarray = order.GetKeyValues(record);
            object[] grouparray;
            if (group.Count > 0)
            {
                grouparray = group.GetValues(record);
            }
            else
            {
                grouparray = new object[1] {
                    linenum
                }
            };
            object[] outputarray = ((output == null) ? null : output.GetValues(record));

            int counter = 0;

            orderarray.CopyTo(keys, counter);
            counter += orderarray.Length;

            grouparray.CopyTo(keys, counter);
            counter += grouparray.Length;

            if (outputarray != null)
            {
                outputarray.CopyTo(keys, counter);
                //counter += outputarray.Length;
            }

            return(keys);
        }
Ejemplo n.º 2
0
        public void Compile()
        {
            try
            {
                _select  = new HqlSelect(_settings);
                _from    = new HqlFrom();
                _where   = new HqlWhere(HqlWhere.NAME_WHERE);
                _groupby = new HqlGroupBy();
                _having  = new HqlHaving(_select);
                _orderby = new HqlOrderBy();

                HqlTokenProcessor processor = new HqlTokenProcessor(_sql, _settings, _references);

                Compile_Inner(processor);

                PostCompile(processor);
            }
            catch
            {
                throw;
            }
        }