예제 #1
0
        public void InsertRowSet(Session session, RowSetNavigator generatedNavigator, RowSetNavigator newData)
        {
            IPersistentStore rowStore = base.BaseTable.GetRowStore(session);
            IRangeIterator   iterator = null;

            if (this.UpdatableTableCheck != null)
            {
                iterator = this._checkRangeVariable.GetIterator(session);
            }
            newData.BeforeFirst();
            if (base.BaseTable.TriggerLists[6].Length != 0)
            {
                while (newData.HasNext())
                {
                    object[] next = newData.GetNext();
                    base.BaseTable.FireTriggers(session, 6, null, next, null);
                }
                newData.BeforeFirst();
            }
            while (newData.HasNext())
            {
                object[] next = newData.GetNext();
                base.BaseTable.InsertSingleRow(session, rowStore, next, null);
                if (iterator != null)
                {
                    iterator.SetCurrent(next);
                    if (!this.UpdatableTableCheck.TestCondition(session))
                    {
                        throw Error.GetError(0x1644);
                    }
                }
                if (generatedNavigator != null)
                {
                    object[] generatedColumns = base.GetGeneratedColumns(next);
                    generatedNavigator.Add(generatedColumns);
                }
            }
            newData.BeforeFirst();
            while (newData.HasNext())
            {
                object[] next = newData.GetNext();
                PerformIntegrityChecks(session, base.BaseTable, null, next, null);
            }
            newData.BeforeFirst();
            if (base.BaseTable.TriggerLists[3].Length != 0)
            {
                while (newData.HasNext())
                {
                    object[] next = newData.GetNext();
                    base.BaseTable.FireTriggers(session, 3, null, next, null);
                }
                newData.BeforeFirst();
            }
        }