collectionloader.cs
来自「NHibernate NET开发者所需的」· CS 代码 · 共 43 行
CS
43 行
using System.Collections.Generic;
using NHibernate.Engine;
using NHibernate.Persister.Collection;
using NHibernate.Type;
namespace NHibernate.Loader.Collection
{
/// <summary>
/// Superclass for loaders that initialize collections
/// <seealso cref="OneToManyLoader" />
/// <seealso cref="BasicCollectionLoader" />
/// </summary>
public class CollectionLoader : OuterJoinLoader, ICollectionInitializer
{
private readonly IQueryableCollection collectionPersister;
public CollectionLoader(IQueryableCollection persister, ISessionFactoryImplementor factory, IDictionary<string, IFilter> enabledFilters)
: base(factory, enabledFilters)
{
collectionPersister = persister;
}
protected internal override bool IsSubselectLoadingEnabled
{
get { return HasSubselectLoadableCollections(); }
}
public virtual void Initialize(object id, ISessionImplementor session)
{
LoadCollection(session, id, KeyType);
}
protected IType KeyType
{
get { return collectionPersister.KeyType; }
}
public override string ToString()
{
return GetType().FullName + '(' + collectionPersister.Role + ')';
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?