当前位置: 首页>>代码示例>>C#>>正文


C# Engine.CascadingAction类代码示例

本文整理汇总了C#中NHibernate.Engine.CascadingAction的典型用法代码示例。如果您正苦于以下问题:C# CascadingAction类的具体用法?C# CascadingAction怎么用?C# CascadingAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CascadingAction类属于NHibernate.Engine命名空间,在下文中一共展示了CascadingAction类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CascadeEntityLoader

        public CascadeEntityLoader(IOuterJoinLoadable persister, CascadingAction action, ISessionFactoryImplementor factory)
            : base(persister, persister.IdentifierType, factory, new CollectionHelper.EmptyMapClass<string, IFilter>())
        {
            JoinWalker walker = new CascadeEntityJoinWalker(persister, action, factory);
            InitFromWalker(walker);

            PostInstantiate();

            log.Debug(string.Format("Static select for action {0} on entity {1}: {2}", action, entityName, SqlString));
        }
开发者ID:zibler,项目名称:zibler,代码行数:10,代码来源:CascadeEntityLoader.cs

示例2: CascadeEntityJoinWalker

		public CascadeEntityJoinWalker(IOuterJoinLoadable persister, CascadingAction action,
		                               ISessionFactoryImplementor factory)
			: base(persister, factory, new CollectionHelper.EmptyMapClass<string, IFilter>())
		{
			cascadeAction = action;
			SqlStringBuilder whereCondition = WhereString(Alias, persister.IdentifierColumnNames, 1)
				//include the discriminator and class-level where, but not filters
				.Add(persister.FilterFragment(Alias, new CollectionHelper.EmptyMapClass<string, IFilter>()));

			InitAll(whereCondition.ToSqlString(), SqlString.Empty, LockMode.Read);
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:11,代码来源:CascadeEntityJoinWalker.cs

示例3: DoCascade

			public override bool DoCascade(CascadingAction action)
			{
				return action == CascadingAction.Delete || action == CascadingAction.SaveUpdate;
			}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:4,代码来源:CascadeStyle.cs

示例4: ReallyDoCascade

			public override bool ReallyDoCascade(CascadingAction action)
			{
				return action == CascadingAction.Delete;
			}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:4,代码来源:CascadeStyle.cs

示例5: Cascade

		public Cascade(CascadingAction action, CascadePoint point, IEventSource eventSource)
		{
			this.point = point;
			this.eventSource = eventSource;
			this.action = action;
		}
开发者ID:paulbatum,项目名称:nhibernate,代码行数:6,代码来源:Cascade.cs

示例6: CascadeCollection

		/// <summary>
		/// Cascade to the collection elements
		/// </summary>
		/// <param name="action"></param>
		/// <param name="style"></param>
		/// <param name="collectionType"></param>
		/// <param name="elemType"></param>
		/// <param name="child"></param>
		/// <param name="cascadeVia"></param>
		/// <param name="session"></param>
		/// <param name="anything"></param>
		private static void CascadeCollection(
			CascadingAction action,
			CascadeStyle style,
			CollectionType collectionType,
			IType elemType,
			object child,
			CascadePoint cascadeVia,
			ISessionImplementor session,
			object anything)
		{
			// cascade to current collection elements
			if (log.IsDebugEnabled)
			{
				log.Debug("cascading to collection: " + collectionType.Role);
			}
			ICollection iter = action.CascadableChildrenCollection(collectionType, child);
			foreach (object obj in iter)
			{
				Cascade(session, obj, elemType, action, style, cascadeVia, anything);
			}

			// handle oprhaned entities!!
			if (style.HasOrphanDelete && action.DeleteOrphans() && child is IPersistentCollection)
			{
				// We can do the cast since orphan-delete does not apply to:
				// 1. newly instatiated collections
				// 2. arrays ( we can't track orphans for detached arrays)
				System.Type entityName = collectionType.GetAssociatedClass(session.Factory);
				DeleteOrphans(entityName, child as IPersistentCollection, session);
			}
		}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:42,代码来源:Cascades.cs

示例7: Cascade

		/// <summary>
		/// Cascade an action from the parent object to all its children.
		/// </summary>
		/// <param name="session"></param>
		/// <param name="persister"></param>
		/// <param name="parent"></param>
		/// <param name="action"></param>
		/// <param name="cascadeTo"></param>
		/// <param name="anything"></param>
		public static void Cascade(ISessionImplementor session, IEntityPersister persister, object parent,
		                           CascadingAction action, CascadePoint cascadeTo, object anything)
		{
			if (persister.HasCascades)
			{
				if (log.IsDebugEnabled)
				{
					log.Debug("processing cascades for: " + persister.ClassName);
				}
				IType[] types = persister.PropertyTypes;
				CascadeStyle[] cascadeStyles = persister.PropertyCascadeStyles;
				for (int i = 0; i < types.Length; i++)
				{
					CascadeStyle style = cascadeStyles[i];
					if (style.DoCascade(action))
					{
						Cascade(session, persister.GetPropertyValue(parent, i), types[i], action, style, cascadeTo, anything);
					}
				}
				if (log.IsDebugEnabled)
				{
					log.Debug("done processing cascades for: " + persister.ClassName);
				}
			}
		}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:34,代码来源:Cascades.cs

示例8: DoCascade

				public override bool DoCascade(CascadingAction action)
				{
					return action == CascadingAction.ActionDelete;
				}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:4,代码来源:Cascades.cs

示例9: DoCascade

			public override bool DoCascade(CascadingAction action)
			{
				return action == CascadingAction.Merge || action == CascadingAction.SaveUpdateCopy;
			}
开发者ID:Ruhollah,项目名称:nhibernate-core,代码行数:4,代码来源:CascadeStyle.cs


注:本文中的NHibernate.Engine.CascadingAction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。