本文整理汇总了C#中ISessionImplementor.GetEntityUsingInterceptor方法的典型用法代码示例。如果您正苦于以下问题:C# ISessionImplementor.GetEntityUsingInterceptor方法的具体用法?C# ISessionImplementor.GetEntityUsingInterceptor怎么用?C# ISessionImplementor.GetEntityUsingInterceptor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISessionImplementor
的用法示例。
在下文中一共展示了ISessionImplementor.GetEntityUsingInterceptor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetRow
/// <summary>
/// Resolve any ids for currently loaded objects, duplications within the <c>IDataReader</c>,
/// etc. Instanciate empty objects to be initialized from the <c>IDataReader</c>. Return an
/// array of objects (a row of results) and an array of booleans (by side-effect) that determine
/// wheter the corresponding object should be initialized
/// </summary>
private object[] GetRow(IDataReader rs, ILoadable[] persisters, EntityKey[] keys, object optionalObject,
EntityKey optionalObjectKey, LockMode[] lockModes, IList hydratedObjects,
ISessionImplementor session)
{
int cols = persisters.Length;
IEntityAliases[] descriptors = EntityAliases;
if (log.IsDebugEnabled)
{
log.Debug("result row: " + StringHelper.ToString(keys));
}
object[] rowResults = new object[cols];
for (int i = 0; i < cols; i++)
{
object obj = null;
EntityKey key = keys[i];
if (keys[i] == null)
{
// do nothing
/* TODO NH-1001 : if (persisters[i]...EntityType) is an OneToMany or a ManyToOne and
* the keys.length > 1 and the relation IsIgnoreNotFound probably we are in presence of
* an load with "outer join" the relation can be considerer loaded even if the key is null (mean not found)
*/
}
else
{
//If the object is already loaded, return the loaded one
obj = session.GetEntityUsingInterceptor(key);
if (obj != null)
{
//its already loaded so dont need to hydrate it
InstanceAlreadyLoaded(rs, i, persisters[i], key, obj, lockModes[i], session);
}
else
{
obj =
InstanceNotYetLoaded(rs, i, persisters[i], key, lockModes[i], descriptors[i].RowIdAlias, optionalObjectKey,
optionalObject, hydratedObjects, session);
}
}
rowResults[i] = obj;
}
return rowResults;
}