|
5 | 5 | using System.Text.RegularExpressions; |
6 | 6 | using NHibernate.Dialect.Function; |
7 | 7 | using NHibernate.Dialect.Schema; |
8 | | -using NHibernate.Driver; |
9 | 8 | using NHibernate.Engine; |
10 | 9 | using NHibernate.Mapping; |
11 | 10 | using NHibernate.SqlCommand; |
@@ -42,6 +41,16 @@ namespace NHibernate.Dialect |
42 | 41 | /// </remarks> |
43 | 42 | public class MsSql2000Dialect : Dialect |
44 | 43 | { |
| 44 | + public const int MaxSizeForAnsiClob = 2147483647; // int.MaxValue |
| 45 | + public const int MaxSizeForClob = 1073741823; // int.MaxValue / 2 |
| 46 | + public const int MaxSizeForBlob = 2147483647; // int.MaxValue |
| 47 | + |
| 48 | + public const int MaxSizeForLengthLimitedAnsiString = 8000; |
| 49 | + public const int MaxSizeForLengthLimitedString = 4000; |
| 50 | + public const int MaxSizeForLengthLimitedBinary = 8000; |
| 51 | + public const byte MaxDateTime2 = 8; |
| 52 | + public const byte MaxDateTimeOffset = 10; |
| 53 | + |
45 | 54 | public MsSql2000Dialect() |
46 | 55 | { |
47 | 56 | RegisterCharacterTypeMappings(); |
@@ -358,8 +367,8 @@ protected virtual void RegisterGuidTypeMapping() |
358 | 367 | protected virtual void RegisterLargeObjectTypeMappings() |
359 | 368 | { |
360 | 369 | RegisterColumnType(DbType.Binary, "VARBINARY(8000)"); |
361 | | - RegisterColumnType(DbType.Binary, SqlClientDriver.MaxSizeForLengthLimitedBinary, "VARBINARY($l)"); |
362 | | - RegisterColumnType(DbType.Binary, SqlClientDriver.MaxSizeForBlob, "IMAGE"); |
| 370 | + RegisterColumnType(DbType.Binary, MaxSizeForLengthLimitedBinary, "VARBINARY($l)"); |
| 371 | + RegisterColumnType(DbType.Binary, MaxSizeForBlob, "IMAGE"); |
363 | 372 | } |
364 | 373 |
|
365 | 374 | protected virtual void RegisterDateTimeTypeMappings() |
@@ -389,13 +398,13 @@ protected virtual void RegisterCharacterTypeMappings() |
389 | 398 | RegisterColumnType(DbType.AnsiStringFixedLength, "CHAR(255)"); |
390 | 399 | RegisterColumnType(DbType.AnsiStringFixedLength, 8000, "CHAR($l)"); |
391 | 400 | RegisterColumnType(DbType.AnsiString, "VARCHAR(255)"); |
392 | | - RegisterColumnType(DbType.AnsiString, SqlClientDriver.MaxSizeForLengthLimitedAnsiString, "VARCHAR($l)"); |
393 | | - RegisterColumnType(DbType.AnsiString, SqlClientDriver.MaxSizeForAnsiClob, "TEXT"); |
| 401 | + RegisterColumnType(DbType.AnsiString, MaxSizeForLengthLimitedAnsiString, "VARCHAR($l)"); |
| 402 | + RegisterColumnType(DbType.AnsiString, MaxSizeForAnsiClob, "TEXT"); |
394 | 403 | RegisterColumnType(DbType.StringFixedLength, "NCHAR(255)"); |
395 | | - RegisterColumnType(DbType.StringFixedLength, SqlClientDriver.MaxSizeForLengthLimitedString, "NCHAR($l)"); |
| 404 | + RegisterColumnType(DbType.StringFixedLength, MaxSizeForLengthLimitedString, "NCHAR($l)"); |
396 | 405 | RegisterColumnType(DbType.String, "NVARCHAR(255)"); |
397 | | - RegisterColumnType(DbType.String, SqlClientDriver.MaxSizeForLengthLimitedString, "NVARCHAR($l)"); |
398 | | - RegisterColumnType(DbType.String, SqlClientDriver.MaxSizeForClob, "NTEXT"); |
| 406 | + RegisterColumnType(DbType.String, MaxSizeForLengthLimitedString, "NVARCHAR($l)"); |
| 407 | + RegisterColumnType(DbType.String, MaxSizeForClob, "NTEXT"); |
399 | 408 | } |
400 | 409 |
|
401 | 410 | public override string AddColumnString |
@@ -447,7 +456,7 @@ public override string GetDropTableString(string tableName) |
447 | 456 | "if exists (select * from dbo.sysobjects where id = object_id(N'{0}') and OBJECTPROPERTY(id, N'IsUserTable') = 1)" + |
448 | 457 | " drop table {0}"; |
449 | 458 |
|
450 | | - return String.Format(dropTable, tableName); |
| 459 | + return string.Format(dropTable, tableName); |
451 | 460 | } |
452 | 461 |
|
453 | 462 | public override string ForUpdateString |
|
0 commit comments