コード例 #1
0
ファイル: HqlWhere.cs プロジェクト: elliottmatt/hqlcs
        public bool Evaluate(HqlRecord record)
        {
            int counter = 0;

            if (_q == null || _q.Count == 0)
            {
                return(true);
            }

            bool?res = HqlEvaluator.Evaluate(record, _q, ref counter);

            return(HqlEvaluator.EvalNullableBool(res, false));
        }
コード例 #2
0
ファイル: HqlCompareToken.cs プロジェクト: elliottmatt/hqlcs
        public bool Evaluate(HqlRecord record)
        {
            switch (_type)
            {
            case HqlCompareTokenType.SINGLE:
                return(HqlEvaluator.EvalNullableBool(EvaluateSingle(record), false));

            case HqlCompareTokenType.IN:
                return(HqlEvaluator.EvalNullableBool(EvaluateInValues(record), false));

            case HqlCompareTokenType.NOT_IN:
                bool b = HqlEvaluator.EvalNullableBool(EvaluateInValues(record), false);     // TODO, should this be true?
                return(!b);

            default:
                throw new NotSupportedException("Unknown type of COMPARETOKEN");
            }
        }
コード例 #3
0
ファイル: HqlWhere.cs プロジェクト: elliottmatt/hqlcs
        public bool EvaluateJoin(HqlValues values, bool returnOnNull)
        {
            // I need the comparer to know if it's part of this table
            // then compare if against a literal and otherwise return true
            // example: if look for table (a)
            // 1) (a.field1 = 'bob') <= actually evaluate
            // 2) (a.field1 = b.field1) <= return true because we need to save this record for
            //    later evaluation
            // 3) (b.field1 = 'joe') <= return false because i don't care about this record
            // 4) (b.field1 is NULL) <= return true because I can't evaluate this here

            int counter = 0;

            if (_q == null || _q.Count == 0)
            {
                return(true);
            }

            bool?res = HqlEvaluator.EvaluateJoin(values, _q, ref counter);

            //return EvalNullableBool(res, true);
            return(HqlEvaluator.EvalNullableBool(res, returnOnNull));
        }