public virtual ObjectReference Reference()
        {
            HardObjectReference hardRef = _transaction.Container().GetHardObjectReferenceById
                                              (_transaction, _id);

            return(hardRef._reference);
        }
Exemplo n.º 2
0
            public void Visit(object a_object)
            {
                DeleteInfo info = (DeleteInfo)a_object;

                if (this._enclosing.LocalContainer().IsDeleted(this._enclosing, info._key))
                {
                    return;
                }
                object obj = null;

                if (info._reference != null)
                {
                    obj = info._reference.GetObject();
                }
                if (obj == null || info._reference.GetID() < 0)
                {
                    HardObjectReference hardRef = this._enclosing.Container().GetHardObjectReferenceById
                                                      (this._enclosing, info._key);
                    if (hardRef == HardObjectReference.Invalid)
                    {
                        return;
                    }
                    info._reference = hardRef._reference;
                    info._reference.FlagForDelete(this._enclosing.Container().TopLevelCallId());
                    obj = info._reference.GetObject();
                }
                this._enclosing.Container().Delete3(this._enclosing, info._reference, obj, info._cascade
                                                    , false);
            }
        protected HardObjectReference GetHardObjectReferenceById(Transaction transaction,
                                                                 int parentId, byte[] signature)
        {
            HardObjectReference hardRef = transaction.Container().GetHardObjectReferenceById(
                transaction, parentId);

            if (hardRef._reference == null)
            {
                return(null);
            }
            VirtualAttributes vad = hardRef._reference.VirtualAttributes(transaction, false);

            if (!Arrays4.Equals(signature, vad.i_database.i_signature))
            {
                return(null);
            }
            return(hardRef);
        }
        public HardObjectReference GetHardObjectReferenceBySignature(Transaction transaction
                                                                     , long longPart, byte[] signature)
        {
            IBTreeRange range = Search(transaction, longPart);
            IEnumerator keys  = range.Keys();

            while (keys.MoveNext())
            {
                IFieldIndexKey      current = (IFieldIndexKey)keys.Current;
                HardObjectReference hardRef = GetHardObjectReferenceById(transaction, current.ParentID
                                                                             (), signature);
                if (null != hardRef)
                {
                    return(hardRef);
                }
            }
            return(HardObjectReference.Invalid);
        }