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


C# Dialect.QuoteForTableName方法代码示例

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


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

示例1: Configure

		/// <summary>
		/// Configures the SequenceGenerator by reading the value of <c>sequence</c> and
		/// <c>schema</c> from the <c>parms</c> parameter.
		/// </summary>
		/// <param name="type">The <see cref="IType"/> the identifier should be.</param>
		/// <param name="parms">An <see cref="IDictionary"/> of Param values that are keyed by parameter name.</param>
		/// <param name="dialect">The <see cref="Dialect.Dialect"/> to help with Configuration.</param>
		public virtual void Configure(IType type, IDictionary<string, string> parms, Dialect.Dialect dialect)
		{
			var nativeSequenceName = PropertiesHelper.GetString(Sequence, parms, "hibernate_sequence");
			bool needQuote = StringHelper.IsBackticksEnclosed(nativeSequenceName);
			bool isQuelified = nativeSequenceName.IndexOf('.') > 0;
			if (isQuelified)
			{
				string qualifier = StringHelper.Qualifier(nativeSequenceName);
				nativeSequenceName = StringHelper.Unqualify(nativeSequenceName);
				nativeSequenceName = StringHelper.PurgeBackticksEnclosing(nativeSequenceName);
				sequenceName = qualifier + '.' + (needQuote ? dialect.QuoteForTableName(nativeSequenceName) : nativeSequenceName);
			}
			else
			{
				nativeSequenceName = StringHelper.PurgeBackticksEnclosing(nativeSequenceName);
				sequenceName = needQuote ? dialect.QuoteForTableName(nativeSequenceName) : nativeSequenceName;
			}
			string schemaName;
			string catalogName;
			parms.TryGetValue(Parameters, out parameters);
			parms.TryGetValue(PersistentIdGeneratorParmsNames.Schema, out schemaName);
			parms.TryGetValue(PersistentIdGeneratorParmsNames.Catalog, out catalogName);

			if (!isQuelified)
			{
				sequenceName = dialect.Qualify(catalogName, schemaName, sequenceName);
			}

			identifierType = type;
			sql = new SqlString(dialect.GetSequenceNextValString(sequenceName));
		}
开发者ID:renefc3,项目名称:nhibernate,代码行数:38,代码来源:SequenceGenerator.cs

示例2: ToSqlText

 public string ToSqlText(DataParameterCollection dpc, Dialect.DbDialect dd)
 {
     return string.Format("{0}.{1} {4} {2}.{3}",
         dd.QuoteForTableName(Table1),
         dd.QuoteForColumnName(Key1),
         dd.QuoteForTableName(Table2),
         dd.QuoteForColumnName(Key2),
         StringHelper.EnumToString(Comp));
 }
开发者ID:991899783,项目名称:DbEntry,代码行数:9,代码来源:JoinClause.cs

示例3: ToSqlText

        //internal FromClause(params string[] linkColumnNames)
        //{
        //    if (linkColumnNames.Length < 2 || linkColumnNames.Length % 2 != 0)
        //    {
        //        throw new ArgumentException("LinkColumnNames.Length not even or less than 2.");
        //    }
        //    joinClauseList = new JoinClause[linkColumnNames.Length / 2];
        //    for (int i = 0; i < linkColumnNames.Length; i+=2)
        //    {
        //        joinClauseList[i / 2] = new JoinClause(linkColumnNames[i], linkColumnNames[i + 1],
        //            CompareOpration.Equal, JoinMode.Inner);
        //    }
        //}

        public string ToSqlText(DataParameterCollection dpc, Dialect.DbDialect dd)
        {
            if (MainTableName != null)
            {
                return dd.QuoteForTableName(MainTableName);
            }

            if (_fromStrings.Contains(dd))
            {
                return (string)_fromStrings[dd];
            }

            string ret;

            if (PartOf != null)
            {
                ret = dd.QuoteForLimitTableName(ModelContext.GetInstance(PartOf).Info.From.MainTableName);
            }
            else
            {
                var sd = new StringDictionary();
                ret = dd.QuoteForTableName(JoinClauseList[0].Table1);
                sd.Add(ret, "");
                for (int i = 0; i < JoinClauseList.Length; i++)
                {
                    if (i != 0 && dd.NeedBracketForJoin)
                    {
                        ret = string.Format("({0})", ret);
                    }
                    string tn = dd.QuoteForTableName(JoinClauseList[i].Table2);
                    if (sd.ContainsKey(tn)) { tn = dd.QuoteForTableName(JoinClauseList[i].Table1); }
                    sd.Add(tn, "");
                    ret = string.Format("{0} {3} JOIN {1} ON {2}",
                                        ret,
                                        tn,
                                        JoinClauseList[i].ToSqlText(dpc, dd),
                                        JoinClauseList[i].Mode);
                }
            }
            lock (_fromStrings.SyncRoot)
            {
                _fromStrings[dd] = ret;
            }
            return ret;
        }
开发者ID:991899783,项目名称:DbEntry,代码行数:59,代码来源:FromClause.cs

示例4: GetQuotedName

		/// <summary>
		/// Gets the name of this Table in quoted form if it is necessary.
		/// </summary>
		/// <param name="dialect">
		/// The <see cref="Dialect.Dialect"/> that knows how to quote the Table name.
		/// </param>
		/// <returns>
		/// The Table name in a form that is safe to use inside of a SQL statement.
		/// Quoted if it needs to be, not quoted if it does not need to be.
		/// </returns>
		public string GetQuotedName( Dialect.Dialect dialect )
		{
			return IsQuoted ?
				dialect.QuoteForTableName( name ) :
				name;
		}
开发者ID:rcarrillopadron,项目名称:nhibernate-1.0.2.0,代码行数:16,代码来源:Table.cs


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