/
MsSql2008Dialect.cs
55 lines (43 loc) · 1.49 KB
/
MsSql2008Dialect.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* *********************************************************************
* Date: 17 Aug 2012
* Created by: Zoltan Juhasz
* E-Mail: forge@jzo.hu
***********************************************************************/
using System.Data;
namespace Forge.DatabaseManagement.SqlServer2008
{
/// <summary>
/// Represents a custom MS SQL Server 2008 NHibernate dialect, which fixes the double bug
/// </summary>
public class MsSql2008Dialect : NHibernate.Dialect.MsSql2008Dialect
{
#region Constructor(s)
/// <summary>
/// Initializes a new instance of the <see cref="MsSql2008Dialect"/> class.
/// </summary>
public MsSql2008Dialect()
: base()
{
}
#endregion
#region Protected method(s)
/// <summary>
/// Registers the character type mappings.
/// </summary>
protected override void RegisterCharacterTypeMappings()
{
base.RegisterCharacterTypeMappings();
base.RegisterColumnType(DbType.String, "NVARCHAR(MAX)");
base.RegisterColumnType(DbType.AnsiString, "VARCHAR(MAX)");
}
/// <summary>
/// Registers the numeric type mappings.
/// </summary>
protected override void RegisterNumericTypeMappings()
{
base.RegisterNumericTypeMappings();
base.RegisterColumnType(DbType.Double, "FLOAT"); // DOUBLE PRECISION changed to FLOAT
}
#endregion
}
}