Example #1
0
		private void DeleteMembers(StatefulBuffer objectBytes)
		{
			ObjectHeader oh = new ObjectHeader(_clazz, objectBytes);
			DeleteInfo info = (DeleteInfo)TreeInt.Find(_transaction._delete, _id);
			if (info != null)
			{
				if (info._cascade > _cascade)
				{
					_cascade = info._cascade;
				}
			}
			objectBytes.SetCascadeDeletes(_cascade);
			DeleteContextImpl context = new DeleteContextImpl(objectBytes, oh, _clazz.ClassReflector
				(), null);
			_clazz.DeleteMembers(context, _typeInfo, true);
		}
Example #2
0
        private void DeleteMembers(StatefulBuffer objectBytes)
        {
            ObjectHeader oh   = new ObjectHeader(_clazz, objectBytes);
            DeleteInfo   info = (DeleteInfo)TreeInt.Find(_transaction._delete, _id);

            if (info != null)
            {
                if (info._cascade > _cascade)
                {
                    _cascade = info._cascade;
                }
            }
            objectBytes.SetCascadeDeletes(_cascade);
            DeleteContextImpl context = new DeleteContextImpl(objectBytes, oh, _clazz.ClassReflector
                                                                  (), null);

            _clazz.DeleteMembers(context, _typeInfo, true);
        }
        public sealed override bool Delete4(Transaction transaction, ObjectReference @ref
                                            , object obj, int cascade, bool userCall)
        {
            int            id     = @ref.GetID();
            StatefulBuffer reader = ReadStatefulBufferById(transaction, id);

            if (reader != null)
            {
                if (obj != null)
                {
                    if ((!ShowInternalClasses()) && Const4.ClassInternal.IsAssignableFrom(obj.GetType
                                                                                              ()))
                    {
                        return(false);
                    }
                }
                reader.SetCascadeDeletes(cascade);
                transaction.IdSystem().NotifySlotDeleted(id, SlotChangeFactory.UserObjects);
                ClassMetadata classMetadata = @ref.ClassMetadata();
                classMetadata.Delete(reader, obj);
                return(true);
            }
            return(false);
        }