• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ILoadable类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ILoadable的典型用法代码示例。如果您正苦于以下问题:C# ILoadable类的具体用法?C# ILoadable怎么用?C# ILoadable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ILoadable类属于命名空间,在下文中一共展示了ILoadable类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ThrowIfTargetNotLoadable

 private void ThrowIfTargetNotLoadable(ILoadable target)
 {
     if(target == null)
     {
         throw new InterceptionTypeNotLoadableException();
     }
 }
开发者ID:akoeplinger,项目名称:YouTrack.Rest,代码行数:7,代码来源:LoadableProxyInterceptor.cs


示例2: InitProjection

		protected void InitProjection(SqlString projectionString, SqlString whereString,
			string orderByString, string groupByString, LockMode lockMode)
		{
			WalkEntityTree(persister, Alias);
			Persisters = new ILoadable[0];
			InitStatementString(projectionString, whereString, orderByString, groupByString, lockMode);
		}
开发者ID:pallmall,项目名称:WCell,代码行数:7,代码来源:AbstractEntityJoinWalker.cs


示例3: DefaultEntityAliases

		/// <summary>
		/// Calculate and cache select-clause suffixes.
		/// </summary>
		public DefaultEntityAliases(IDictionary<string, string[]> userProvidedAliases, ILoadable persister, string suffix)
		{
			this.suffix = suffix;
			this.userProvidedAliases = userProvidedAliases;

			string[] keyColumnsCandidates = GetUserProvidedAliases(persister.IdentifierPropertyName, null);
			if (keyColumnsCandidates == null)
			{
				suffixedKeyColumns = GetUserProvidedAliases(EntityPersister.EntityID, GetIdentifierAliases(persister, suffix));
			}
			else
			{
				suffixedKeyColumns = keyColumnsCandidates;
			}
			Intern(suffixedKeyColumns);

			suffixedPropertyColumns = GetSuffixedPropertyAliases(persister);
			suffixedDiscriminatorColumn =
				GetUserProvidedAlias(AbstractEntityPersister.EntityClass, GetDiscriminatorAlias(persister, suffix));
			if (persister.IsVersioned)
			{
				suffixedVersionColumn = suffixedPropertyColumns[persister.VersionProperty];
			}
			else
			{
				suffixedVersionColumn = null;
			}
			rowIdAlias = Loadable.RowIdAlias + suffix; // TODO: not visible to the user!
		}
开发者ID:jlevitt,项目名称:nhibernate-core,代码行数:32,代码来源:DefaultEntityAliases.cs


示例4: SimpleEntityLoader

		public SimpleEntityLoader( ILoadable persister, SqlString sql, LockMode lockMode )
		{
			this.persister = new ILoadable[ ] {persister};
			this.idType = persister.IdentifierType;
			this.sql = sql;
			this.lockMode = new LockMode[ ] {lockMode};
			PostInstantiate();
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:8,代码来源:SimpleEntityLoader.cs


示例5: RenderStatement

		private void RenderStatement( ILoadable[ ] persisters )
		{
			int loadables = persisters.Length;

			Persisters = persisters;
			Suffixes = GenerateSuffixes( loadables );
			lockModeArray = CreateLockModeArray( loadables, LockMode.None );

			SqlString = SubstituteParams( SubstituteBrackets() );
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:10,代码来源:SqlLoader.cs


示例6: SubselectFetch

		public SubselectFetch(string alias, ILoadable loadable, QueryParameters queryParameters,
		                      ISet<EntityKey> resultingEntityKeys)
		{
			this.resultingEntityKeys = resultingEntityKeys;
			this.queryParameters = queryParameters;
			this.loadable = loadable;
			this.alias = alias;

			queryString = queryParameters.ProcessedSql.GetSubselectString();
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:10,代码来源:SubselectFetch.cs


示例7: InitClassPersisters

		protected void InitClassPersisters( IList associations )
		{
			int joins = CountClassPersisters( associations );

			collectionOwner = -1; // if no collection found
			classPersisters = new ILoadable[ joins + 1 ];
			Owners = new int[ joins + 1 ];
			aliases = new string[ joins + 1 ];
			lockModeArray = CreateLockModeArray( joins + 1, LockMode.None );
			int i = 0;
			foreach( OuterJoinableAssociation oj in associations )
			{
				object subpersister = oj.Joinable;
				if( subpersister is ILoadable )
				{
					classPersisters[ i ] = ( ILoadable ) subpersister;
					Owners[ i ] = ToOwner( oj, joins, oj.IsOneToOne );
					aliases[ i ] = oj.Subalias;
					if( oj.JoinType == JoinType.InnerJoin )
					{
						AddAllToPropertySpaces( classPersisters[ i ].PropertySpaces );
					}
					i++;
				}
				else
				{
					IQueryableCollection collPersister = ( IQueryableCollection ) subpersister;
					// TODO: ?? suppress initialization of collections with a where condition
					if( oj.JoinType == JoinType.LeftOuterJoin )
					{
						collectionPersister = collPersister;
						collectionOwner = ToOwner( oj, joins, true );
					}
					else
					{
						AddToPropertySpaces( collPersister.CollectionSpace );
					}

					if( collPersister.IsOneToMany )
					{
						classPersisters[ i ] = ( ILoadable ) collPersister.ElementPersister;
						aliases[ i ] = oj.Subalias;
						i++;
					}
				}
			}
			classPersisters[ joins ] = persister;
			Owners[ joins ] = -1;
			aliases[ joins ] = alias;

			if( ArrayHelper.IsAllNegative( Owners ) )
			{
				Owners = null;
			}
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:55,代码来源:AbstractEntityLoader.cs


示例8: SubselectFetch

		public SubselectFetch(string alias, ILoadable loadable, QueryParameters queryParameters,
		                      ISet<EntityKey> resultingEntityKeys, IDictionary<string, int[]> namedParameterLocMap)
		{
			this.resultingEntityKeys = resultingEntityKeys;
			this.queryParameters = queryParameters;
			this.namedParameterLocMap = namedParameterLocMap;
			this.loadable = loadable;
			this.alias = alias;

			queryString = queryParameters.FilteredSQL.GetSubselectString();
		}
开发者ID:Mrding,项目名称:Ribbon,代码行数:11,代码来源:SubselectFetch.cs


示例9: InitProjection

		protected void InitProjection(CriteriaQueryTranslator translator, 
			IDictionary<string, IFilter> enabledFilters, LockMode lockMode)
		{
			// the order of the calls here is important, as the join clauses can contain parameter bindings
			SqlString projectionString = translator.GetSelect(enabledFilters);
			WalkEntityTree(persister, Alias);
			SqlString whereString = translator.GetWhereCondition(enabledFilters);
			SqlString orderByString = translator.GetOrderBy();
			SqlString groupByString = translator.GetGroupBy();
			SqlString havingString = translator.GetHavingCondition(enabledFilters);
			
			Persisters = new ILoadable[0];
			InitStatementString(projectionString, whereString, orderByString, groupByString.ToString(), 
                havingString, lockMode);
		}
开发者ID:renefc3,项目名称:nhibernate,代码行数:15,代码来源:AbstractEntityJoinWalker.cs


示例10: InitClassPersisters

		private void InitClassPersisters( IList associations )
		{
			int joins = associations.Count;
			lockModeArray = CreateLockModeArray( joins, LockMode.None );

			classPersisters = new ILoadable[joins];
			Owners = new int[joins];

			int i = 0;
			foreach( OuterJoinableAssociation oj in associations )
			{
				classPersisters[ i ] = ( ILoadable ) oj.Joinable;
				Owners[ i ] = ToOwner( oj, joins, oj.IsOneToOne );
				i++;
			}

			if( ArrayHelper.IsAllNegative( Owners ) )
			{
				Owners = null;
			}
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:21,代码来源:CollectionLoader.cs


示例11: InitClassPersisters

		private void InitClassPersisters( IOuterJoinLoadable persister, IList associations )
		{
			int joins = associations.Count;
			lockModeArray = CreateLockModeArray( joins + 1, LockMode.None );

			classPersisters = new ILoadable[joins + 1];
			Owners = new int[ joins + 1 ];
			for( int i = 0; i < joins; i++ )
			{
				OuterJoinableAssociation oj = ( OuterJoinableAssociation ) associations[ i ];
				Persisters[ i ] = (ILoadable) oj.Joinable;
				Owners[ i ] = ToOwner( oj, joins, oj.IsOneToOne );
			}
			classPersisters[ joins ] = persister;
			Owners[ joins ] = -1;

			if ( ArrayHelper.IsAllNegative( Owners ) )
			{
				Owners = null;
			}
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:21,代码来源:OneToManyLoader.cs


示例12: GenerateSequentialSelect

		private SqlString GenerateSequentialSelect(ILoadable persister)
		{
			//note that this method could easily be moved up to BasicEntityPersister,
			//if we ever needed to reuse it from other subclasses

			//figure out which tables need to be fetched
			AbstractEntityPersister subclassPersister = (AbstractEntityPersister)persister;
			HashedSet<int> tableNumbers = new HashedSet<int>();
			string[] props = subclassPersister.PropertyNames;
			string[] classes = subclassPersister.PropertySubclassNames;
			for (int i = 0; i < props.Length; i++)
			{
				int propTableNumber = GetSubclassPropertyTableNumber(props[i], classes[i]);
				if (IsSubclassTableSequentialSelect(propTableNumber) && !IsSubclassTableLazy(propTableNumber))
				{
					tableNumbers.Add(propTableNumber);
				}
			}
			if ((tableNumbers.Count == 0))
				return null;

			//figure out which columns are needed
			List<int> columnNumbers = new List<int>();
			int[] columnTableNumbers = SubclassColumnTableNumberClosure;
			for (int i = 0; i < SubclassColumnClosure.Length; i++)
			{
				if (tableNumbers.Contains(columnTableNumbers[i]))
					columnNumbers.Add(i);
			}

			//figure out which formulas are needed
			List<int> formulaNumbers = new List<int>();
			int[] formulaTableNumbers = SubclassColumnTableNumberClosure;
			for (int i = 0; i < SubclassFormulaTemplateClosure.Length; i++)
			{
				if (tableNumbers.Contains(formulaTableNumbers[i]))
					formulaNumbers.Add(i);
			}

			//render the SQL
			return RenderSelect(ArrayHelper.ToIntArray(tableNumbers), columnNumbers.ToArray(), formulaNumbers.ToArray());
		}
开发者ID:juanplopes,项目名称:nhibernate,代码行数:42,代码来源:SingleTableEntityPersister.cs


示例13: GetPropertyAliases

		protected override string[] GetPropertyAliases(ILoadable persister, int j)
		{
			return persister.GetPropertyColumnNames(j);
		}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:4,代码来源:ColumnEntityAliases.cs


示例14: GetDiscriminatorAlias

		protected override string GetDiscriminatorAlias(ILoadable persister, string suffix)
		{
			return persister.DiscriminatorColumnName;
		}
开发者ID:Novthirteen,项目名称:sconit_timesseiko,代码行数:4,代码来源:ColumnEntityAliases.cs


示例15: GetSuffixedPropertyAliases

		public string[][] GetSuffixedPropertyAliases(ILoadable persister)
		{
			int size = persister.PropertyNames.Length;
			string[][] suffixedPropertyAliases = new string[size][];
			for (int j = 0; j < size; j++)
			{
				suffixedPropertyAliases[j] = GetUserProvidedAliases(persister.PropertyNames[j], GetPropertyAliases(persister, j));
				Intern(suffixedPropertyAliases[j]);
			}
			return suffixedPropertyAliases;
		}
开发者ID:jlevitt,项目名称:nhibernate-core,代码行数:11,代码来源:DefaultEntityAliases.cs


示例16: InstanceNotYetLoaded

		/// <summary>
		/// The entity instance is not in the session cache
		/// </summary>
		private object InstanceNotYetLoaded(IDataReader dr, int i, ILoadable persister, EntityKey key, LockMode lockMode,
		                                    string rowIdAlias, EntityKey optionalObjectKey, object optionalObject,
		                                    IList hydratedObjects, ISessionImplementor session)
		{
			object obj;

			string instanceClass = GetInstanceClass(dr, i, persister, key.Identifier, session);

			if (optionalObjectKey != null && key.Equals(optionalObjectKey))
			{
				// its the given optional object
				obj = optionalObject;
			}
			else
			{
				obj = session.Instantiate(instanceClass, key.Identifier);
			}

			// need to hydrate it

			// grab its state from the DataReader and keep it in the Session
			// (but don't yet initialize the object itself)
			// note that we acquired LockMode.READ even if it was not requested
			LockMode acquiredLockMode = lockMode == LockMode.None ? LockMode.Read : lockMode;
			LoadFromResultSet(dr, i, obj, instanceClass, key, rowIdAlias, acquiredLockMode, persister, session);

			// materialize associations (and initialize the object) later
			hydratedObjects.Add(obj);

			return obj;
		}
开发者ID:remcoros,项目名称:nhibernate,代码行数:34,代码来源:Loader.cs


示例17: GetInstanceClass

		/// <summary>
		/// Determine the concrete class of an instance for the <c>IDataReader</c>
		/// </summary>
		private string GetInstanceClass(IDataReader rs, int i, ILoadable persister, object id, ISessionImplementor session)
		{
			if (persister.HasSubclasses)
			{
				// code to handle subclasses of topClass
				object discriminatorValue =
					persister.DiscriminatorType.NullSafeGet(rs, EntityAliases[i].SuffixedDiscriminatorAlias, session, null);

				string result = persister.GetSubclassForDiscriminatorValue(discriminatorValue);

				if (result == null)
				{
					// woops we got an instance of another class hierarchy branch.
					throw new WrongClassException(string.Format("Discriminator was: '{0}'", discriminatorValue), id,
					                              persister.EntityName);
				}

				return result;
			}
			else
			{
				return persister.EntityName;
			}
		}
开发者ID:remcoros,项目名称:nhibernate,代码行数:27,代码来源:Loader.cs


示例18: LoadWaiter

        public LoadWaiter(ILoadable[] loadables, Loader.LoadedCallbackMethod loadedCallback)
        {
            this.loadables = loadables;
            LoadedCallback = loadedCallback;

            Loader.AddLoadable(this);
        }
开发者ID:reignstudios,项目名称:ReignSDK,代码行数:7,代码来源:Loader.cs


示例19: ColumnEntityAliases

		public ColumnEntityAliases(IDictionary<string, string[]> returnProperties, ILoadable persister)
			: base(returnProperties, persister, null) {}
开发者ID:ggeurts,项目名称:nhibernate-core,代码行数:2,代码来源:ColumnEntityAliases.cs


示例20: InitProjection

		protected void InitProjection(SqlString projectionString, SqlString whereString, SqlString orderByString, SqlString groupByString, SqlString havingString, IDictionary<string, IFilter> enabledFilters, LockMode lockMode)
		{
			WalkEntityTree(persister, Alias);
			Persisters = new ILoadable[0];
			InitStatementString(projectionString, whereString, orderByString, groupByString.ToString(), havingString, lockMode);
		}
开发者ID:NikGovorov,项目名称:nhibernate-core,代码行数:6,代码来源:AbstractEntityJoinWalker.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ILoader类代码示例发布时间:2022-05-24
下一篇:
C# ILiveTvManager类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap