예제 #1
0
        internal virtual IConstraint Join1(QCon
                                           a_with, bool a_and)
        {
            if (a_with is QConstraints)
            {
                var j           = 0;
                var joinHooks   = new Collection4();
                var constraints = ((QConstraints)a_with).ToArray();
                for (j = 0; j < constraints.Length; j++)
                {
                    joinHooks.Ensure(((QCon)constraints[j]).
                                     JoinHook());
                }
                var joins = new IConstraint[joinHooks.Size()];
                j = 0;
                var i = joinHooks.GetEnumerator();
                while (i.MoveNext())
                {
                    joins[j++] = Join((IConstraint)i.Current, a_and);
                }
                return(new QConstraints(i_trans, joins));
            }
            var myHook    = JoinHook();
            var otherHook = a_with.JoinHook();

            if (myHook == otherHook)
            {
                // You might like to check out, what happens, if you
                // remove this line. It seems to open a bug in an
                // StOr testcase.
                return(myHook);
            }
            var cj = new QConJoin(i_trans, myHook, otherHook, a_and);

            myHook.AddJoin(cj);
            otherHook.AddJoin(cj);
            return(cj);
        }
예제 #2
0
파일: QCon.cs 프로젝트: masroore/db4o
 internal virtual IConstraint Join1(QCon
     a_with, bool a_and)
 {
     if (a_with is QConstraints)
     {
         var j = 0;
         var joinHooks = new Collection4();
         var constraints = ((QConstraints) a_with).ToArray();
         for (j = 0; j < constraints.Length; j++)
         {
             joinHooks.Ensure(((QCon) constraints[j]).
                 JoinHook());
         }
         var joins = new IConstraint[joinHooks.Size()];
         j = 0;
         var i = joinHooks.GetEnumerator();
         while (i.MoveNext())
         {
             joins[j++] = Join((IConstraint) i.Current, a_and);
         }
         return new QConstraints(i_trans, joins);
     }
     var myHook = JoinHook();
     var otherHook = a_with.JoinHook();
     if (myHook == otherHook)
     {
         // You might like to check out, what happens, if you
         // remove this line. It seems to open a bug in an
         // StOr testcase.
         return myHook;
     }
     var cj = new QConJoin(i_trans, myHook, otherHook, a_and);
     myHook.AddJoin(cj);
     otherHook.AddJoin(cj);
     return cj;
 }