///
@@ -188,5 +188,15 @@ private static int GetAfterSelectInsertPoint(SqlString sql)
}
return 0;
}
+
+ ///
+ /// by default for SQL Anywhere,
+ /// .
+ protected override bool EscapeBackslashInStrings { get; set; } = true;
+
+ ///
+ /// by default for SQL Anywhere,
+ /// .
+ protected override bool UseNPrefixForUnicodeStrings => true;
}
}
diff --git a/src/NHibernate/Dialect/SybaseSQLAnywhere10Dialect.cs b/src/NHibernate/Dialect/SybaseSQLAnywhere10Dialect.cs
index 290e626671f..ac5aa44f8e0 100644
--- a/src/NHibernate/Dialect/SybaseSQLAnywhere10Dialect.cs
+++ b/src/NHibernate/Dialect/SybaseSQLAnywhere10Dialect.cs
@@ -969,5 +969,15 @@ public override IDataBaseSchema GetDataBaseSchema(DbConnection connection)
///
/// SQL Anywhere has a micro-second resolution.
public override long TimestampResolutionInTicks => 10L;
+
+ ///
+ /// by default for SQL Anywhere,
+ /// .
+ protected override bool EscapeBackslashInStrings { get; set; } = true;
+
+ ///
+ /// by default for SQL Anywhere,
+ /// .
+ protected override bool UseNPrefixForUnicodeStrings => true;
}
}
diff --git a/src/NHibernate/Proxy/DefaultDynamicProxyMethodCheckerExtensions.cs b/src/NHibernate/Proxy/DefaultDynamicProxyMethodCheckerExtensions.cs
index b25c01c9fea..f57cf3fe287 100644
--- a/src/NHibernate/Proxy/DefaultDynamicProxyMethodCheckerExtensions.cs
+++ b/src/NHibernate/Proxy/DefaultDynamicProxyMethodCheckerExtensions.cs
@@ -23,12 +23,10 @@ public static bool IsProxiable(this MethodInfo method)
public static bool ShouldBeProxiable(this MethodInfo method)
{
// to use only for real methods (no getter/setter)
- return (method.DeclaringType != typeof (MarshalByRefObject)) &&
- !IsFinalizeMethod(method) &&
- (!(method.DeclaringType == typeof (object) && "GetType".Equals(method.Name))) &&
- (!(method.DeclaringType == typeof (object) && "obj_address".Equals(method.Name))) && // Mono-specific method
+ return method.DeclaringType != typeof(MarshalByRefObject) &&
+ !(method.DeclaringType == typeof(object) && !method.IsVirtual) &&
!IsDisposeMethod(method) &&
- (method.IsPublic || method.IsAssembly || method.IsFamilyOrAssembly);
+ (method.IsPublic || method.IsAssembly || method.IsFamilyOrAssembly);
}
public static bool ShouldBeProxiable(this PropertyInfo propertyInfo)
diff --git a/src/NHibernate/Proxy/DynProxyTypeValidator.cs b/src/NHibernate/Proxy/DynProxyTypeValidator.cs
index 2f0370c3628..b53df86c5b6 100644
--- a/src/NHibernate/Proxy/DynProxyTypeValidator.cs
+++ b/src/NHibernate/Proxy/DynProxyTypeValidator.cs
@@ -50,9 +50,8 @@ protected virtual void CheckAccessibleMembersAreVirtual(System.Type type)
foreach (var member in members)
{
- if (member is PropertyInfo)
+ if (member is PropertyInfo property)
{
- var property = (PropertyInfo) member;
if(property.ShouldBeProxiable())
{
MethodInfo[] accessors = property.GetAccessors(true);
@@ -66,21 +65,19 @@ protected virtual void CheckAccessibleMembersAreVirtual(System.Type type)
}
}
}
- else if (member is MethodInfo)
+ else if (member is MethodInfo method)
{
- var methodInfo = (MethodInfo) member;
// avoid the check of properties getter and setter because already checked when the PropertyInfo was found.
- if (!IsPropertyMethod(methodInfo) && methodInfo.ShouldBeProxiable())
+ if (!IsPropertyMethod(method) && method.ShouldBeProxiable())
{
- CheckMethodIsVirtual(type, methodInfo);
+ CheckMethodIsVirtual(type, method);
}
}
- else if (member is FieldInfo)
+ else if (member is FieldInfo field)
{
- var memberField = (FieldInfo) member;
- if (memberField.IsPublic || memberField.IsAssembly || memberField.IsFamilyOrAssembly)
+ if (field.IsPublic || field.IsAssembly || field.IsFamilyOrAssembly)
{
- EnlistError(type, "field " + member.Name + " should not be public nor internal (ecapsulate it in a property).");
+ EnlistError(type, "field " + field.Name + " should not be public nor internal (ecapsulate it in a property).");
}
}
}
diff --git a/src/NHibernate/SqlCommand/SqlInsertBuilder.cs b/src/NHibernate/SqlCommand/SqlInsertBuilder.cs
index 0a8f88883f8..d71774848b9 100644
--- a/src/NHibernate/SqlCommand/SqlInsertBuilder.cs
+++ b/src/NHibernate/SqlCommand/SqlInsertBuilder.cs
@@ -66,6 +66,8 @@ public virtual SqlInsertBuilder AddColumn(string columnName, IType propertyType)
/// The value to set for the column.
/// The NHibernateType to use to convert the value to a sql string.
/// The SqlInsertBuilder.
+ // Since v5.6
+ [Obsolete("This method is unsafe and has no more usages. Use the overload with a property type and use a parameterized query.")]
public SqlInsertBuilder AddColumn(string columnName, object val, ILiteralType literalType)
{
return AddColumn(columnName, literalType.ObjectToSQLString(val, Dialect));
diff --git a/src/NHibernate/SqlCommand/SqlUpdateBuilder.cs b/src/NHibernate/SqlCommand/SqlUpdateBuilder.cs
index 80c154ffdf8..cb4d316961d 100644
--- a/src/NHibernate/SqlCommand/SqlUpdateBuilder.cs
+++ b/src/NHibernate/SqlCommand/SqlUpdateBuilder.cs
@@ -47,6 +47,8 @@ public SqlUpdateBuilder SetComment(string comment)
/// The value to set for the column.
/// The NHibernateType to use to convert the value to a sql string.
/// The SqlUpdateBuilder.
+ // Since v5.6
+ [Obsolete("This method is unsafe and has no more usages. Use the overload with a property type and use a parameterized query.")]
public SqlUpdateBuilder AddColumn(string columnName, object val, ILiteralType literalType)
{
return AddColumn(columnName, literalType.ObjectToSQLString(val, Dialect));
diff --git a/src/NHibernate/Type/AbstractCharType.cs b/src/NHibernate/Type/AbstractCharType.cs
index ba2ad5bb761..dd53c1de5f2 100644
--- a/src/NHibernate/Type/AbstractCharType.cs
+++ b/src/NHibernate/Type/AbstractCharType.cs
@@ -39,9 +39,7 @@ public override void Set(DbCommand cmd, object value, int index, ISessionImpleme
}
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
- {
- return '\'' + value.ToString() + '\'';
- }
+ => dialect.ToStringLiteral(value.ToString(), SqlType);
// 6.0 TODO: rename "xml" parameter as "value": it is not a xml string. The fact it generally comes from a xml
// attribute value is irrelevant to the method behavior.
diff --git a/src/NHibernate/Type/AbstractDateTimeType.cs b/src/NHibernate/Type/AbstractDateTimeType.cs
index 9deb2273d3e..fb197523518 100644
--- a/src/NHibernate/Type/AbstractDateTimeType.cs
+++ b/src/NHibernate/Type/AbstractDateTimeType.cs
@@ -167,7 +167,7 @@ public override object FromStringValue(string xml)
public override object DefaultValue => BaseDateValue;
///
- public override string ObjectToSQLString(object value, Dialect.Dialect dialect) =>
- "'" + (DateTime) value + "'";
+ public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
+ => dialect.ToStringLiteral(((DateTime) value).ToString(), SqlTypeFactory.GetAnsiString(50));
}
}
diff --git a/src/NHibernate/Type/AbstractStringType.cs b/src/NHibernate/Type/AbstractStringType.cs
index e5c073b7df7..eb820a1c234 100644
--- a/src/NHibernate/Type/AbstractStringType.cs
+++ b/src/NHibernate/Type/AbstractStringType.cs
@@ -129,10 +129,9 @@ public object StringToObject(string xml)
#region ILiteralType Members
+ ///
public string ObjectToSQLString(object value, Dialect.Dialect dialect)
- {
- return "'" + (string)value + "'";
- }
+ => dialect.ToStringLiteral((string)value, SqlType);
#endregion
diff --git a/src/NHibernate/Type/ByteType.cs b/src/NHibernate/Type/ByteType.cs
index f52071890ff..3047665a943 100644
--- a/src/NHibernate/Type/ByteType.cs
+++ b/src/NHibernate/Type/ByteType.cs
@@ -2,6 +2,7 @@
using System.Collections;
using System.Data;
using System.Data.Common;
+using System.Globalization;
using System.Numerics;
using NHibernate.Engine;
using NHibernate.SqlTypes;
@@ -46,7 +47,7 @@ public override void Set(DbCommand cmd, object value, int index, ISessionImpleme
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
{
- return value.ToString();
+ return ((byte)value).ToString(CultureInfo.InvariantCulture);
}
// 6.0 TODO: rename "xml" parameter as "value": it is not a xml string. The fact it generally comes from a xml
diff --git a/src/NHibernate/Type/CharBooleanType.cs b/src/NHibernate/Type/CharBooleanType.cs
index 1224fb363d5..9536ce4c790 100644
--- a/src/NHibernate/Type/CharBooleanType.cs
+++ b/src/NHibernate/Type/CharBooleanType.cs
@@ -51,9 +51,7 @@ private string ToCharacter(object value)
}
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
- {
- return "'" + ToCharacter(value) + "'";
- }
+ => dialect.ToStringLiteral(ToCharacter(value), SqlType);
// 6.0 TODO: rename "xml" parameter as "value": it is not a xml string. The fact it generally comes from a xml
// attribute value is irrelevant to the method behavior.
diff --git a/src/NHibernate/Type/DateTimeOffSetType.cs b/src/NHibernate/Type/DateTimeOffSetType.cs
index 10bfa4f6804..78d4f9b233c 100644
--- a/src/NHibernate/Type/DateTimeOffSetType.cs
+++ b/src/NHibernate/Type/DateTimeOffSetType.cs
@@ -129,8 +129,6 @@ public override object FromStringValue(string xml)
}
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
- {
- return "'" + ((DateTimeOffset) value) + "'";
- }
+ => dialect.ToStringLiteral(((DateTimeOffset) value).ToString(), SqlTypeFactory.GetAnsiString(50));
}
}
diff --git a/src/NHibernate/Type/DateType.cs b/src/NHibernate/Type/DateType.cs
index 7bf772c9e95..65b7024b646 100644
--- a/src/NHibernate/Type/DateType.cs
+++ b/src/NHibernate/Type/DateType.cs
@@ -94,8 +94,8 @@ public override string ToString(object val) =>
public override object DefaultValue => customBaseDate;
///
- public override string ObjectToSQLString(object value, Dialect.Dialect dialect) =>
- "\'" + ((DateTime)value).ToShortDateString() + "\'";
+ public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
+ => dialect.ToStringLiteral(((DateTime) value).ToShortDateString(), SqlTypeFactory.GetAnsiString(50));
// Since v5
[Obsolete("Its only parameter, BaseValue, is obsolete.")]
diff --git a/src/NHibernate/Type/DecimalType.cs b/src/NHibernate/Type/DecimalType.cs
index e2398ec4ce6..1987ae23280 100644
--- a/src/NHibernate/Type/DecimalType.cs
+++ b/src/NHibernate/Type/DecimalType.cs
@@ -1,6 +1,7 @@
using System;
using System.Data;
using System.Data.Common;
+using System.Globalization;
using NHibernate.Engine;
using NHibernate.SqlTypes;
@@ -53,7 +54,7 @@ public override object FromStringValue(string xml)
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
{
- return value.ToString();
+ return ((decimal)value).ToString(CultureInfo.InvariantCulture);
}
// 6.0 TODO: rename "xml" parameter as "value": it is not a xml string. The fact it generally comes from a xml
diff --git a/src/NHibernate/Type/DoubleType.cs b/src/NHibernate/Type/DoubleType.cs
index 45b5713f525..880842b5ba8 100644
--- a/src/NHibernate/Type/DoubleType.cs
+++ b/src/NHibernate/Type/DoubleType.cs
@@ -1,6 +1,7 @@
using System;
using System.Data;
using System.Data.Common;
+using System.Globalization;
using System.Numerics;
using NHibernate.Engine;
using NHibernate.SqlTypes;
@@ -59,7 +60,7 @@ public override object FromStringValue(string xml)
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
{
- return value.ToString();
+ return ((double)value).ToString(CultureInfo.InvariantCulture);
}
}
}
diff --git a/src/NHibernate/Type/EnumCharType.cs b/src/NHibernate/Type/EnumCharType.cs
index 1068642ac09..8ebf6b47020 100644
--- a/src/NHibernate/Type/EnumCharType.cs
+++ b/src/NHibernate/Type/EnumCharType.cs
@@ -166,8 +166,6 @@ public override object FromStringValue(string xml)
}
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
- {
- return '\'' + GetValue(value).ToString() + '\'';
- }
+ => dialect.ToStringLiteral(GetValue(value).ToString(), SqlType);
}
}
diff --git a/src/NHibernate/Type/GuidType.cs b/src/NHibernate/Type/GuidType.cs
index 2dc627d5d09..1c26e399418 100644
--- a/src/NHibernate/Type/GuidType.cs
+++ b/src/NHibernate/Type/GuidType.cs
@@ -73,7 +73,7 @@ public object StringToObject(string xml)
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
{
- return "'" + value + "'";
+ return dialect.ToStringLiteral(value.ToString(), SqlTypeFactory.GetAnsiString(50));
}
}
}
diff --git a/src/NHibernate/Type/Int16Type.cs b/src/NHibernate/Type/Int16Type.cs
index cfd21908465..8e1566ae42b 100644
--- a/src/NHibernate/Type/Int16Type.cs
+++ b/src/NHibernate/Type/Int16Type.cs
@@ -1,11 +1,12 @@
using System;
using System.Collections;
-using System.Data.Common;
-using NHibernate.Engine;
-using NHibernate.SqlTypes;
using System.Collections.Generic;
using System.Data;
+using System.Data.Common;
+using System.Globalization;
using System.Numerics;
+using NHibernate.Engine;
+using NHibernate.SqlTypes;
namespace NHibernate.Type
{
@@ -89,7 +90,7 @@ public virtual object Seed(ISessionImplementor session)
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
{
- return value.ToString();
+ return ((short)value).ToString(CultureInfo.InvariantCulture);
}
}
}
diff --git a/src/NHibernate/Type/Int32Type.cs b/src/NHibernate/Type/Int32Type.cs
index f19fb1148fd..f5a63bf38a2 100644
--- a/src/NHibernate/Type/Int32Type.cs
+++ b/src/NHibernate/Type/Int32Type.cs
@@ -1,11 +1,12 @@
using System;
using System.Collections;
-using System.Data.Common;
-using NHibernate.Engine;
-using NHibernate.SqlTypes;
using System.Collections.Generic;
using System.Data;
+using System.Data.Common;
+using System.Globalization;
using System.Numerics;
+using NHibernate.Engine;
+using NHibernate.SqlTypes;
namespace NHibernate.Type
{
@@ -93,7 +94,7 @@ public virtual object Seed(ISessionImplementor session)
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
{
- return value.ToString();
+ return ((int)value).ToString(CultureInfo.InvariantCulture);
}
}
}
diff --git a/src/NHibernate/Type/Int64Type.cs b/src/NHibernate/Type/Int64Type.cs
index b86cb619443..0a93fad7138 100644
--- a/src/NHibernate/Type/Int64Type.cs
+++ b/src/NHibernate/Type/Int64Type.cs
@@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
+using System.Globalization;
using System.Numerics;
using NHibernate.Engine;
using NHibernate.SqlTypes;
@@ -93,7 +94,7 @@ public virtual object Seed(ISessionImplementor session)
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
{
- return value.ToString();
+ return ((long)value).ToString(CultureInfo.InvariantCulture);
}
}
}
diff --git a/src/NHibernate/Type/SByteType.cs b/src/NHibernate/Type/SByteType.cs
index 513cacb6e70..12728690e63 100644
--- a/src/NHibernate/Type/SByteType.cs
+++ b/src/NHibernate/Type/SByteType.cs
@@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
+using System.Globalization;
using System.Numerics;
using NHibernate.Engine;
using NHibernate.SqlTypes;
@@ -91,7 +92,7 @@ public virtual object Seed(ISessionImplementor session)
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
{
- return value.ToString();
+ return ((sbyte)value).ToString(CultureInfo.InvariantCulture);
}
}
}
diff --git a/src/NHibernate/Type/SingleType.cs b/src/NHibernate/Type/SingleType.cs
index a5d56ce9ade..aa2b296679a 100644
--- a/src/NHibernate/Type/SingleType.cs
+++ b/src/NHibernate/Type/SingleType.cs
@@ -1,6 +1,7 @@
using System;
using System.Data;
using System.Data.Common;
+using System.Globalization;
using System.Numerics;
using NHibernate.Engine;
using NHibernate.SqlTypes;
@@ -75,7 +76,7 @@ public override object FromStringValue(string xml)
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
{
- return value.ToString();
+ return ((float)value).ToString(CultureInfo.InvariantCulture);
}
}
}
diff --git a/src/NHibernate/Type/TicksType.cs b/src/NHibernate/Type/TicksType.cs
index 4fc18a007cd..bc82d101df8 100644
--- a/src/NHibernate/Type/TicksType.cs
+++ b/src/NHibernate/Type/TicksType.cs
@@ -1,6 +1,7 @@
using System;
using System.Data;
using System.Data.Common;
+using System.Globalization;
using NHibernate.Engine;
using NHibernate.SqlTypes;
@@ -100,7 +101,7 @@ public override object Seed(ISessionImplementor session)
///
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
{
- return '\'' + ((DateTime)value).Ticks.ToString() + '\'';
+ return '\'' + ((DateTime)value).Ticks.ToString(CultureInfo.InvariantCulture) + '\'';
}
}
}
diff --git a/src/NHibernate/Type/TimeAsTimeSpanType.cs b/src/NHibernate/Type/TimeAsTimeSpanType.cs
index f5218c0775c..a91b4f07975 100644
--- a/src/NHibernate/Type/TimeAsTimeSpanType.cs
+++ b/src/NHibernate/Type/TimeAsTimeSpanType.cs
@@ -1,10 +1,11 @@
using System;
using System.Collections;
+using System.Collections.Generic;
+using System.Data;
using System.Data.Common;
+using System.Globalization;
using NHibernate.Engine;
using NHibernate.SqlTypes;
-using System.Collections.Generic;
-using System.Data;
namespace NHibernate.Type
{
@@ -117,7 +118,7 @@ public override object FromStringValue(string xml)
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
{
- return '\'' + ((TimeSpan)value).Ticks.ToString() + '\'';
+ return '\'' + ((TimeSpan)value).Ticks.ToString(CultureInfo.InvariantCulture) + '\'';
}
}
}
diff --git a/src/NHibernate/Type/TimeSpanType.cs b/src/NHibernate/Type/TimeSpanType.cs
index ed37b4629d2..b8cf39d8d20 100644
--- a/src/NHibernate/Type/TimeSpanType.cs
+++ b/src/NHibernate/Type/TimeSpanType.cs
@@ -1,10 +1,11 @@
using System;
using System.Collections;
+using System.Collections.Generic;
+using System.Data;
using System.Data.Common;
+using System.Globalization;
using NHibernate.Engine;
using NHibernate.SqlTypes;
-using System.Collections.Generic;
-using System.Data;
namespace NHibernate.Type
{
@@ -101,7 +102,7 @@ public override object FromStringValue(string xml)
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
{
- return '\'' + ((TimeSpan)value).Ticks.ToString() + '\'';
+ return '\'' + ((TimeSpan)value).Ticks.ToString(CultureInfo.InvariantCulture) + '\'';
}
}
}
diff --git a/src/NHibernate/Type/TimeType.cs b/src/NHibernate/Type/TimeType.cs
index c095ef0c0d2..e50957e8e68 100644
--- a/src/NHibernate/Type/TimeType.cs
+++ b/src/NHibernate/Type/TimeType.cs
@@ -166,8 +166,6 @@ public override object DefaultValue
}
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
- {
- return "'" + ((DateTime)value).ToShortTimeString() + "'";
- }
+ => dialect.ToStringLiteral(((DateTime) value).ToShortTimeString(), SqlTypeFactory.GetAnsiString(50));
}
}
diff --git a/src/NHibernate/Type/UInt16Type.cs b/src/NHibernate/Type/UInt16Type.cs
index c37bbfaca75..4913c0fc792 100644
--- a/src/NHibernate/Type/UInt16Type.cs
+++ b/src/NHibernate/Type/UInt16Type.cs
@@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
+using System.Globalization;
using System.Numerics;
using NHibernate.Engine;
using NHibernate.SqlTypes;
@@ -93,7 +94,7 @@ public virtual object Seed(ISessionImplementor session)
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
{
- return value.ToString();
+ return ((ushort)value).ToString(CultureInfo.InvariantCulture);
}
}
}
diff --git a/src/NHibernate/Type/UInt32Type.cs b/src/NHibernate/Type/UInt32Type.cs
index e0e30b65f2f..0f1a739e5ab 100644
--- a/src/NHibernate/Type/UInt32Type.cs
+++ b/src/NHibernate/Type/UInt32Type.cs
@@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
+using System.Globalization;
using System.Numerics;
using NHibernate.Engine;
using NHibernate.SqlTypes;
@@ -93,7 +94,7 @@ public virtual object Seed(ISessionImplementor session)
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
{
- return value.ToString();
+ return ((uint)value).ToString(CultureInfo.InvariantCulture);
}
}
}
diff --git a/src/NHibernate/Type/UInt64Type.cs b/src/NHibernate/Type/UInt64Type.cs
index 8d0c05d20b1..333fd9b0dc6 100644
--- a/src/NHibernate/Type/UInt64Type.cs
+++ b/src/NHibernate/Type/UInt64Type.cs
@@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
+using System.Globalization;
using System.Numerics;
using NHibernate.Engine;
using NHibernate.SqlTypes;
@@ -92,7 +93,7 @@ public virtual object Seed(ISessionImplementor session)
public override string ObjectToSQLString(object value, Dialect.Dialect dialect)
{
- return value.ToString();
+ return ((ulong)value).ToString(CultureInfo.InvariantCulture);
}
}
}
diff --git a/src/NHibernate/Type/UriType.cs b/src/NHibernate/Type/UriType.cs
index 48fbe91a9c8..59f9ec61238 100644
--- a/src/NHibernate/Type/UriType.cs
+++ b/src/NHibernate/Type/UriType.cs
@@ -79,9 +79,7 @@ public override object FromStringValue(string xml)
}
public string ObjectToSQLString(object value, Dialect.Dialect dialect)
- {
- return "'" + ((Uri)value).OriginalString + "'";
- }
+ => dialect.ToStringLiteral(((Uri) value).OriginalString, SqlType);
///
public override object Assemble(object cached, ISessionImplementor session, object owner)
diff --git a/src/NHibernate/nhibernate-configuration.xsd b/src/NHibernate/nhibernate-configuration.xsd
index 12abc622a52..4c6390bbea8 100644
--- a/src/NHibernate/nhibernate-configuration.xsd
+++ b/src/NHibernate/nhibernate-configuration.xsd
@@ -176,6 +176,14 @@
+
+
+
+ Indicates if the database needs to have backslash escaped in string literals. The default is
+ dialect dependent.
+
+
+
diff --git a/teamcity.build b/teamcity.build
index 9319ed389fc..0d2955c26b7 100644
--- a/teamcity.build
+++ b/teamcity.build
@@ -137,7 +137,7 @@
-
+