You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assert.That(script,Does.Contain("if exists (select 1 from sys.objects where object_id = OBJECT_ID(N'dbo.[Aclasses_Id_FK]') AND parent_object_id = OBJECT_ID('dbo.Aclass'))"));
38
+
Assert.That(script,Does.Contain("if exists (select 1 from nhibernate.sys.objects where object_id = OBJECT_ID(N'nhibernate.dbo.[Aclasses_Id_FK]') and parent_object_id = OBJECT_ID(N'nhibernate.dbo.Aclass'))"));
SqlStringstr=d.GetLimitString(newSqlString("select distinct c.Contact_Id as Contact1_19_0_, c.Rating as Rating2_19_0_, c.Last_Name as Last_Name3_19_0, c.First_Name as First_Name4_19_0 from dbo.Contact c where COALESCE(c.Rating, 0) > 0 order by c.Rating desc , c.Last_Name , c.First_Name"),newSqlString("111"),newSqlString("222"));
20
+
varstr=d.GetLimitString(newSqlString("select distinct c.Contact_Id as Contact1_19_0_, c.Rating as Rating2_19_0_, c.Last_Name as Last_Name3_19_0, c.First_Name as First_Name4_19_0 from dbo.Contact c where COALESCE(c.Rating, 0) > 0 order by c.Rating desc , c.Last_Name , c.First_Name"),newSqlString("111"),newSqlString("222"));
21
21
Assert.AreEqual(
22
22
"SELECT TOP (222) Contact1_19_0_, Rating2_19_0_, Last_Name3_19_0, First_Name4_19_0 FROM (SELECT *, ROW_NUMBER() OVER(ORDER BY q_.Rating2_19_0_ DESC, q_.Last_Name3_19_0, q_.First_Name4_19_0) as __hibernate_sort_row FROM (select distinct c.Contact_Id as Contact1_19_0_, c.Rating as Rating2_19_0_, c.Last_Name as Last_Name3_19_0, c.First_Name as First_Name4_19_0 from dbo.Contact c where COALESCE(c.Rating, 0) > 0) as q_) as query WHERE query.__hibernate_sort_row > 111 ORDER BY query.__hibernate_sort_row",
23
23
str.ToString());
@@ -74,19 +74,19 @@ public void OnlyOffsetLimit()
74
74
{
75
75
vard=newMsSql2005Dialect();
76
76
77
-
SqlStringstr=d.GetLimitString(newSqlString("select distinct c.Contact_Id as Contact1_19_0_, c._Rating as Rating2_19_0_ from dbo.Contact c where COALESCE(c.Rating, 0) > 0 order by c.Rating desc , c.Last_Name , c.First_Name"),null,newSqlString("10"));
77
+
varstr=d.GetLimitString(newSqlString("select distinct c.Contact_Id as Contact1_19_0_, c._Rating as Rating2_19_0_ from dbo.Contact c where COALESCE(c.Rating, 0) > 0 order by c.Rating desc , c.Last_Name , c.First_Name"),null,newSqlString("10"));
78
78
Assert.That(str.ToString(),Is.EqualTo("select distinct TOP (10) c.Contact_Id as Contact1_19_0_, c._Rating as Rating2_19_0_ from dbo.Contact c where COALESCE(c.Rating, 0) > 0 order by c.Rating desc , c.Last_Name , c.First_Name"));
79
79
}
80
80
81
81
[Test]
82
82
publicvoidNH1187()
83
83
{
84
-
MsSql2005Dialectd=newMsSql2005Dialect();
85
-
SqlStringresult=d.GetLimitString(newSqlString("select concat(a.Description,', ', a.Description) as desc from Animal a"),newSqlString("111"),newSqlString("222"));
84
+
vard=newMsSql2005Dialect();
85
+
varresult=d.GetLimitString(newSqlString("select concat(a.Description,', ', a.Description) as desc from Animal a"),newSqlString("111"),newSqlString("222"));
86
86
Assert.AreEqual("SELECT TOP (222) desc FROM (select concat(a.Description,', ', a.Description) as desc, ROW_NUMBER() OVER(ORDER BY CURRENT_TIMESTAMP) as __hibernate_sort_row from Animal a) as query WHERE query.__hibernate_sort_row > 111 ORDER BY query.__hibernate_sort_row",result.ToString());
87
87
88
88
// The test use the function "cast" because cast need the keyWork "as" too
89
-
SqlStringstr=d.GetLimitString(newSqlString("SELECT fish.id, cast('astring, with,comma' as string) as bar FROM fish"),newSqlString("111"),newSqlString("222"));
89
+
varstr=d.GetLimitString(newSqlString("SELECT fish.id, cast('astring, with,comma' as string) as bar FROM fish"),newSqlString("111"),newSqlString("222"));
90
90
Assert.AreEqual(
91
91
"SELECT TOP (222) id, bar FROM (SELECT fish.id, cast('astring, with,comma' as string) as bar, ROW_NUMBER() OVER(ORDER BY CURRENT_TIMESTAMP) as __hibernate_sort_row FROM fish) as query WHERE query.__hibernate_sort_row > 111 ORDER BY query.__hibernate_sort_row",
Assert.That(script,Does.Contain("if exists (select 1 from sys.objects where object_id = OBJECT_ID(N'dbo.[Aclasses_Id_FK]') AND parent_object_id = OBJECT_ID('dbo.Aclass'))"));
26
+
Assert.That(script,Does.Contain("if exists (select 1 from nhibernate.sys.objects where object_id = OBJECT_ID(N'nhibernate.dbo.[Aclasses_Id_FK]') and parent_object_id = OBJECT_ID(N'nhibernate.dbo.Aclass'))"));
0 commit comments