示例#1
0
        public ForeignKeyCheckerUB1(UnaryTableUpdater source, BinaryTableUpdater target)
        {
            Debug.Assert(source.store == target.store1);

            this.source = source;
            this.target = target;
        }
示例#2
0
        public ForeignKeyCheckerBU1(BinaryTableUpdater source, UnaryTableUpdater target)
        {
            Debug.Assert(source.store1 == target.store);

            this.source = source;
            this.target = target;
        }
示例#3
0
        public ForeignKeyCheckerBT(BinaryTableUpdater source, TernaryTableUpdater target)
        {
            Debug.Assert(source.store1 == target.store1 & source.store2 == target.store2);

            this.source = source;
            this.target = target;
        }
示例#4
0
        private void CheckTargetDeletes()
        {
            long[] buffer = target.Deletes(longBuff, counter);
            int    count  = counter[0];

            for (int i = 0; i < count; i++)
            {
                long entry = buffer[i];
                int  arg1  = BinaryTableUpdater.Arg1(entry);
                int  arg2  = BinaryTableUpdater.Arg2(entry);
                if (source.Contains12(arg1, arg2) && !target.Contains(arg1, arg2))
                {
                    throw DeletionForeignKeyViolation(arg1, arg2);
                }
            }
        }
示例#5
0
        public void Check()
        {
            if (source.HasInsertions())
            {
                long[] buffer = source.Insertions(this.buffer, counter);
                int    count  = counter[0];
                for (int i = 0; i < count; i++)
                {
                    long entry = buffer[i];
                    int  arg1  = BinaryTableUpdater.Arg1(entry);
                    if (!target.Contains(arg1))
                    {
                        throw InsertionForeignKeyViolation(arg1, BinaryTableUpdater.Arg2(entry));
                    }
                }
            }

            target.CheckDeletedKeys(this);
        }
示例#6
0
 public ForeignKeyCheckerBU2(BinaryTableUpdater source, UnaryTableUpdater target)
 {
     this.source = source;
     this.target = target;
 }