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


C# ISessionImplementor.InitializeEntity方法代码示例

本文整理汇总了C#中ISessionImplementor.InitializeEntity方法的典型用法代码示例。如果您正苦于以下问题:C# ISessionImplementor.InitializeEntity方法的具体用法?C# ISessionImplementor.InitializeEntity怎么用?C# ISessionImplementor.InitializeEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISessionImplementor的用法示例。


在下文中一共展示了ISessionImplementor.InitializeEntity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitializeEntitiesAndCollections

		private void InitializeEntitiesAndCollections( IList hydratedObjects, object resultSetId, ISessionImplementor session )
		{
			if( Persisters.Length > 0 )
			{
				int hydratedObjectsSize = hydratedObjects.Count;

				if( log.IsDebugEnabled )
				{
					log.Debug( string.Format( "total objects hydrated: {0}", hydratedObjectsSize ) );
				}

				for( int i = 0; i < hydratedObjectsSize; i++ )
				{
					session.InitializeEntity( hydratedObjects[ i ] );
				}
			}

			ICollectionPersister collectionPersister = CollectionPersister;
			if( collectionPersister != null )
			{
				//this is a query and we are loading multiple instances of the same collection role
				session.EndLoadingCollections( collectionPersister, resultSetId );
			}
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:24,代码来源:Loader.cs

示例2: Load

		public object Load(object id, object optionalObject, LockMode lockMode, ISessionImplementor session)
		{
			Custom clone = null;
			Custom obj = (Custom) Instances[id];
			if(obj!=null) 
			{
				clone = (Custom)obj.Clone();
				session.AddUninitializedEntity( new Key(id, this), clone, LockMode.None );
				session.PostHydrate( this, id, new string[] {obj.Name}, clone, LockMode.None );
				session.InitializeEntity(clone);
			}
			return clone;

		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:14,代码来源:CustomPersister.cs

示例3: InitializeEntitiesAndCollections

		internal void InitializeEntitiesAndCollections(
			IList hydratedObjects,
			object resultSetId,
			ISessionImplementor session)
		{
			ICollectionPersister[] collectionPersisters = CollectionPersisters;
			if (collectionPersisters != null)
			{
				for (int i = 0; i < collectionPersisters.Length; i++)
				{
					if (collectionPersisters[i].IsArray)
					{
						//for arrays, we should end the collection load before resolving
						//the entities, since the actual array instances are not instantiated
						//during loading
						//TODO: or we could do this polymorphically, and have two
						//      different operations implemented differently for arrays
						EndCollectionLoad(resultSetId, session, collectionPersisters[i]);
					}
				}
			}

			if (hydratedObjects != null)
			{
				int hydratedObjectsSize = hydratedObjects.Count;

				if (log.IsDebugEnabled)
				{
					log.Debug(string.Format("total objects hydrated: {0}", hydratedObjectsSize));
				}

				for (int i = 0; i < hydratedObjectsSize; i++)
				{
					session.InitializeEntity(hydratedObjects[i]);
				}
			}

			if (collectionPersisters != null)
			{
				for (int i = 0; i < collectionPersisters.Length; i++)
				{
					if (!collectionPersisters[i].IsArray)
					{
						//for sets, we should end the collection load after resolving
						//the entities, since we might call hashCode() on the elements
						//TODO: or we could do this polymorphically, and have two
						//      different operations implemented differently for arrays
						EndCollectionLoad(resultSetId, session, collectionPersisters[i]);
					}
				}
			}
		}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:52,代码来源:Loader.cs


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