本文整理汇总了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));
}
示例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);
}
示例3: DoCascade
public override bool DoCascade(CascadingAction action)
{
return action == CascadingAction.Delete || action == CascadingAction.SaveUpdate;
}
示例4: ReallyDoCascade
public override bool ReallyDoCascade(CascadingAction action)
{
return action == CascadingAction.Delete;
}
示例5: Cascade
public Cascade(CascadingAction action, CascadePoint point, IEventSource eventSource)
{
this.point = point;
this.eventSource = eventSource;
this.action = action;
}
示例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);
}
}
示例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);
}
}
}
示例8: DoCascade
public override bool DoCascade(CascadingAction action)
{
return action == CascadingAction.ActionDelete;
}
示例9: DoCascade
public override bool DoCascade(CascadingAction action)
{
return action == CascadingAction.Merge || action == CascadingAction.SaveUpdateCopy;
}