Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Util
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14691/NHibernate/Util
Modified Files:
StringHelper.cs
Log Message:
Still working on alias. Except for one testcase, everything looks ok.
Index: StringHelper.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/StringHelper.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** StringHelper.cs 12 Apr 2004 05:38:19 -0000 1.9
--- StringHelper.cs 15 Apr 2004 13:21:19 -0000 1.10
***************
*** 15,18 ****
--- 15,20 ----
public const string SqlParameter = "?";
+ public static Dialect.Dialect Dialect;
+
[Obsolete("Use String.Join() instead of this method. It does the same thing")]
public static string Join(string separator, string[] strings) {
***************
*** 132,149 ****
char quote = name[0];
! bool nameEscaped = Dialect.Dialect.Quote.IndexOf(quote) > -1;
! StringBuilder nameBuffer = new StringBuilder(30);
!
! if (nameEscaped) {
! nameBuffer.Append( name.Substring(1, name.Length-1) ).Append(suffix);
! } else {
! nameBuffer.Append(name).Append(suffix);
! }
!
! if (nameEscaped) {
! nameBuffer.Insert(0, quote);
! nameBuffer.Append(quote);
! }
! return nameBuffer.ToString();
}
--- 134,141 ----
char quote = name[0];
! if (UnQuote(name) != name)
! return Dialect.QuoteForColumnName(UnQuote(name) + suffix);
! else
! return Dialect.QuoteForColumnName(name + suffix);
}
***************
*** 204,210 ****
public static string UnQuote(string name) {
! return ( Dialect.Dialect.Quote.IndexOf( name[0] ) > -1 )
! ? name.Substring(1, name.Length-1)
! : name;
}
--- 196,200 ----
public static string UnQuote(string name) {
! return Dialect.UnQuote(name);
}
|