本文整理汇总了C#中IAbstractComponentType.GetFetchMode方法的典型用法代码示例。如果您正苦于以下问题:C# IAbstractComponentType.GetFetchMode方法的具体用法?C# IAbstractComponentType.GetFetchMode怎么用?C# IAbstractComponentType.GetFetchMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAbstractComponentType
的用法示例。
在下文中一共展示了IAbstractComponentType.GetFetchMode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WalkComponentTree
/// <summary>
/// For a component, add to a list of associations to be fetched by outerjoin
/// </summary>
protected void WalkComponentTree(IAbstractComponentType componentType, int begin, string alias, string path,
int currentDepth, ILhsAssociationTypeSqlInfo associationTypeSQLInfo)
{
IType[] types = componentType.Subtypes;
string[] propertyNames = componentType.PropertyNames;
for (int i = 0; i < types.Length; i++)
{
if (types[i].IsAssociationType)
{
var associationType = (IAssociationType) types[i];
string[] aliasedLhsColumns = associationTypeSQLInfo.GetAliasedColumnNames(associationType, begin);
string[] lhsColumns = associationTypeSQLInfo.GetColumnNames(associationType, begin);
string lhsTable = associationTypeSQLInfo.GetTableName(associationType);
string subpath = SubPath(path, propertyNames[i]);
bool[] propertyNullability = componentType.PropertyNullability;
JoinType joinType = GetJoinType(associationType, componentType.GetFetchMode(i), subpath, lhsTable, lhsColumns,
propertyNullability == null || propertyNullability[i], currentDepth,
componentType.GetCascadeStyle(i));
AddAssociationToJoinTreeIfNecessary(associationType, aliasedLhsColumns, alias, subpath, currentDepth, joinType);
}
else if (types[i].IsComponentType)
{
string subpath = SubPath(path, propertyNames[i]);
WalkComponentTree((IAbstractComponentType) types[i], begin, alias, subpath, currentDepth, associationTypeSQLInfo);
}
begin += types[i].GetColumnSpan(Factory);
}
}
示例2: WalkCompositeElementTree
/// <summary>
/// For a composite element, add to a list of associations to be fetched by outerjoin
/// </summary>
private void WalkCompositeElementTree(IAbstractComponentType compositeType, string[] cols,
IQueryableCollection persister, string alias, string path, int currentDepth)
{
IType[] types = compositeType.Subtypes;
string[] propertyNames = compositeType.PropertyNames;
int begin = 0;
for (int i = 0; i < types.Length; i++)
{
int length = types[i].GetColumnSpan(factory);
string[] lhsColumns = ArrayHelper.Slice(cols, begin, length);
if (types[i].IsAssociationType)
{
IAssociationType associationType = types[i] as IAssociationType;
// simple, because we can't have a one-to-one or collection
// (or even a property-ref) in a composite element:
string[] aliasedLhsColumns = StringHelper.Qualify(alias, lhsColumns);
string subpath = SubPath(path, propertyNames[i]);
bool[] propertyNullability = compositeType.PropertyNullability;
JoinType joinType =
GetJoinType(associationType, compositeType.GetFetchMode(i), subpath, persister.TableName, lhsColumns,
propertyNullability == null || propertyNullability[i], currentDepth, compositeType.GetCascadeStyle(i));
AddAssociationToJoinTreeIfNecessary(associationType, aliasedLhsColumns, alias, subpath, currentDepth, joinType);
}
else if (types[i].IsComponentType)
{
string subpath = SubPath(path, propertyNames[i]);
WalkCompositeElementTree((IAbstractComponentType)types[i], lhsColumns, persister, alias, subpath, currentDepth);
}
begin += length;
}
}
示例3: WalkComponentTree
/// <summary>
/// For a component, add to a list of associations to be fetched by outerjoin
/// </summary>
private void WalkComponentTree(IAbstractComponentType componentType, int propertyNumber, int begin,
IOuterJoinLoadable persister, string alias, string path, int currentDepth)
{
IType[] types = componentType.Subtypes;
string[] propertyNames = componentType.PropertyNames;
for (int i = 0; i < types.Length; i++)
{
if (types[i].IsAssociationType)
{
IAssociationType associationType = (IAssociationType)types[i];
string[] aliasedLhsColumns =
JoinHelper.GetAliasedLHSColumnNames(associationType, alias, propertyNumber, begin, persister, Factory);
string[] lhsColumns = JoinHelper.GetLHSColumnNames(associationType, propertyNumber, begin, persister, Factory);
string lhsTable = JoinHelper.GetLHSTableName(associationType, propertyNumber, persister);
string subpath = SubPath(path, propertyNames[i]);
bool[] propertyNullability = componentType.PropertyNullability;
JoinType joinType =
GetJoinType(associationType, componentType.GetFetchMode(i), subpath, lhsTable, lhsColumns,
propertyNullability == null || propertyNullability[i], currentDepth, componentType.GetCascadeStyle(i));
AddAssociationToJoinTreeIfNecessary(associationType, aliasedLhsColumns, alias, subpath, currentDepth, joinType);
}
else if (types[i].IsComponentType)
{
string subpath = SubPath(path, propertyNames[i]);
WalkComponentTree((IAbstractComponentType)types[i], propertyNumber, begin, persister, alias, subpath, currentDepth);
}
begin += types[i].GetColumnSpan(Factory);
}
}