|
From: Michael D. <mik...@us...> - 2004-04-16 04:13:31
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Sql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31801/NHibernate/Sql Modified Files: Alias.cs Log Message: Modified Alias so that only items that need to be Quoted will be quoted. See SimpleComponent.hbm.xml for quoting columns. Index: Alias.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Sql/Alias.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Alias.cs 15 Apr 2004 13:40:43 -0000 1.6 --- Alias.cs 16 Apr 2004 04:13:22 -0000 1.7 *************** *** 27,43 **** public string ToAliasString(string sqlIdentifier, Dialect.Dialect dialect) { ! if (dialect.UnQuote(sqlIdentifier) != sqlIdentifier) { ! sqlIdentifier = dialect.UnQuote(sqlIdentifier); } ! if ( sqlIdentifier.Length > length ) { ! sqlIdentifier = sqlIdentifier.Substring(0, length); } ! if (suffix!=null) sqlIdentifier += suffix; - return dialect.QuoteForAliasName(sqlIdentifier); } --- 27,58 ---- public string ToAliasString(string sqlIdentifier, Dialect.Dialect dialect) { ! bool isQuoted = dialect.IsQuoted(sqlIdentifier); ! string unquoted; ! ! if(isQuoted) { ! unquoted = dialect.UnQuote(sqlIdentifier); ! } ! else ! { ! unquoted = sqlIdentifier; } ! if ( unquoted.Length > length ) { ! unquoted = unquoted.Substring(0, length); } ! if (suffix!=null) unquoted += suffix; ! ! if ( isQuoted ) ! { ! return dialect.QuoteForAliasName(unquoted); ! } ! else ! { ! return unquoted; ! } } |