77
88namespace NHibernate . Test . ExpressionTest . Projection
99{
10- using Util ;
11- using NHibernate . Dialect . Function ;
10+ using NHibernate . Dialect . Function ;
1211
1312 [ TestFixture ]
1413 public class ProjectionFixture : BaseExpressionFixture
@@ -19,7 +18,7 @@ public void RowCountTest()
1918 ISession session = factory . OpenSession ( ) ;
2019 IProjection expression = Projections . RowCount ( ) ;
2120 CreateObjects ( typeof ( Simple ) , session ) ;
22- SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery , new CollectionHelper . EmptyMapClass < string , IFilter > ( ) ) ;
21+ SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery ) ;
2322 string expectedSql = "count(*) as y0_" ;
2423 CompareSqlStrings ( sqlString , expectedSql , 0 ) ;
2524 session . Close ( ) ;
@@ -34,7 +33,7 @@ public void AvgTest()
3433 IType nhType = NHibernateUtil . GuessType ( typeof ( double ) ) ;
3534 SqlType [ ] sqlTypes = nhType . SqlTypes ( this . factoryImpl ) ;
3635 string sqlTypeString = factoryImpl . Dialect . GetCastTypeName ( sqlTypes [ 0 ] ) ;
37- SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery , new CollectionHelper . EmptyMapClass < string , IFilter > ( ) ) ;
36+ SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery ) ;
3837 string expectedSql = string . Format ( "avg(cast(sql_alias.Pay as {0})) as y0_" , sqlTypeString ) ;
3938 CompareSqlStrings ( sqlString , expectedSql , 0 ) ;
4039 session . Close ( ) ;
@@ -46,7 +45,7 @@ public void MaxTest()
4645 ISession session = factory . OpenSession ( ) ;
4746 IProjection expression = Projections . Max ( "Pay" ) ;
4847 CreateObjects ( typeof ( Simple ) , session ) ;
49- SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery , new CollectionHelper . EmptyMapClass < string , IFilter > ( ) ) ;
48+ SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery ) ;
5049 string expectedSql = "max(sql_alias.Pay) as y0_" ;
5150 CompareSqlStrings ( sqlString , expectedSql , 0 ) ;
5251 session . Close ( ) ;
@@ -58,7 +57,7 @@ public void MinTest()
5857 ISession session = factory . OpenSession ( ) ;
5958 IProjection expression = Projections . Min ( "Pay" ) ;
6059 CreateObjects ( typeof ( Simple ) , session ) ;
61- SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery , new CollectionHelper . EmptyMapClass < string , IFilter > ( ) ) ;
60+ SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery ) ;
6261 string expectedSql = "min(sql_alias.Pay) as y0_" ;
6362 CompareSqlStrings ( sqlString , expectedSql , 0 ) ;
6463 session . Close ( ) ;
@@ -70,7 +69,7 @@ public void CountTest()
7069 ISession session = factory . OpenSession ( ) ;
7170 IProjection expression = Projections . Count ( "Pay" ) ;
7271 CreateObjects ( typeof ( Simple ) , session ) ;
73- SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery , new CollectionHelper . EmptyMapClass < string , IFilter > ( ) ) ;
72+ SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery ) ;
7473 string expectedSql = "count(sql_alias.Pay) as y0_" ;
7574 CompareSqlStrings ( sqlString , expectedSql , 0 ) ;
7675 session . Close ( ) ;
@@ -82,7 +81,7 @@ public void CountDistinctTest()
8281 ISession session = factory . OpenSession ( ) ;
8382 IProjection expression = Projections . CountDistinct ( "Pay" ) ;
8483 CreateObjects ( typeof ( Simple ) , session ) ;
85- SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery , new CollectionHelper . EmptyMapClass < string , IFilter > ( ) ) ;
84+ SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery ) ;
8685 string expectedSql = "count(distinct sql_alias.Pay) as y0_" ;
8786 CompareSqlStrings ( sqlString , expectedSql , 0 ) ;
8887 session . Close ( ) ;
@@ -95,7 +94,7 @@ public void NvlTest()
9594 IProjection expression = Projections . SqlFunction ( new NvlFunction ( ) ,
9695 NHibernateUtil . String , Projections . Property ( "Name" ) , Projections . Property ( "Address" ) ) ;
9796 CreateObjects ( typeof ( Simple ) , session ) ;
98- SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery , new CollectionHelper . EmptyMapClass < string , IFilter > ( ) ) ;
97+ SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery ) ;
9998 string expectedSql = "nvl(sql_alias.Name, sql_alias.address) as y0_" ;
10099 CompareSqlStrings ( sqlString , expectedSql , 0 ) ;
101100 session . Close ( ) ;
@@ -107,7 +106,7 @@ public void DistinctTest()
107106 ISession session = factory . OpenSession ( ) ;
108107 IProjection expression = Projections . Distinct ( Projections . Property ( "Pay" ) ) ;
109108 CreateObjects ( typeof ( Simple ) , session ) ;
110- SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery , new CollectionHelper . EmptyMapClass < string , IFilter > ( ) ) ;
109+ SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery ) ;
111110 string expectedSql = "distinct sql_alias.Pay as y0_" ;
112111 CompareSqlStrings ( sqlString , expectedSql , 0 ) ;
113112 session . Close ( ) ;
@@ -119,10 +118,10 @@ public void GroupPropertyTest()
119118 ISession session = factory . OpenSession ( ) ;
120119 IProjection expression = Projections . GroupProperty ( "Pay" ) ;
121120 CreateObjects ( typeof ( Simple ) , session ) ;
122- SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery , new CollectionHelper . EmptyMapClass < string , IFilter > ( ) ) ;
121+ SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery ) ;
123122 string expectedSql = "sql_alias.Pay as y0_" ;
124123 CompareSqlStrings ( sqlString , expectedSql , 0 ) ;
125- SqlString groupSql = expression . ToGroupSqlString ( criteria , criteriaQuery , new CollectionHelper . EmptyMapClass < string , IFilter > ( ) ) ;
124+ SqlString groupSql = expression . ToGroupSqlString ( criteria , criteriaQuery ) ;
126125 string expectedGroupSql = "sql_alias.Pay" ;
127126 CompareSqlStrings ( groupSql , expectedGroupSql ) ;
128127 session . Close ( ) ;
@@ -134,7 +133,7 @@ public void IdTest()
134133 ISession session = factory . OpenSession ( ) ;
135134 IProjection expression = Projections . Id ( ) ;
136135 CreateObjects ( typeof ( Simple ) , session ) ;
137- SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery , new CollectionHelper . EmptyMapClass < string , IFilter > ( ) ) ;
136+ SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery ) ;
138137 string expectedSql = "sql_alias.id_ as y0_" ;
139138 CompareSqlStrings ( sqlString , expectedSql , 0 ) ;
140139 session . Close ( ) ;
@@ -146,7 +145,7 @@ public void PropertyTest()
146145 ISession session = factory . OpenSession ( ) ;
147146 IProjection expression = Projections . Property ( "Pay" ) ;
148147 CreateObjects ( typeof ( Simple ) , session ) ;
149- SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery , new CollectionHelper . EmptyMapClass < string , IFilter > ( ) ) ;
148+ SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery ) ;
150149 string expectedSql = "sql_alias.Pay as y0_" ;
151150 CompareSqlStrings ( sqlString , expectedSql , 0 ) ;
152151 session . Close ( ) ;
@@ -161,7 +160,7 @@ public void SqlGroupProjectionTest()
161160 new IType [ ] { NHibernateUtil . Double }
162161 ) ;
163162 CreateObjects ( typeof ( Simple ) , session ) ;
164- SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery , new CollectionHelper . EmptyMapClass < string , IFilter > ( ) ) ;
163+ SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery ) ;
165164 string expectedSql = "count(Pay)" ;
166165 CompareSqlStrings ( sqlString , expectedSql , 0 ) ;
167166 session . Close ( ) ;
@@ -175,7 +174,7 @@ public void SqlProjectionTest()
175174 new string [ ] { "CountOfPay" } , new
176175 IType [ ] { NHibernateUtil . Double } ) ;
177176 CreateObjects ( typeof ( Simple ) , session ) ;
178- SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery , new CollectionHelper . EmptyMapClass < string , IFilter > ( ) ) ;
177+ SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery ) ;
179178 string expectedSql = "count(Pay)" ;
180179 CompareSqlStrings ( sqlString , expectedSql , 0 ) ;
181180 session . Close ( ) ;
@@ -187,7 +186,7 @@ public void SumTest()
187186 ISession session = factory . OpenSession ( ) ;
188187 IProjection expression = Projections . Sum ( "Pay" ) ;
189188 CreateObjects ( typeof ( Simple ) , session ) ;
190- SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery , new CollectionHelper . EmptyMapClass < string , IFilter > ( ) ) ;
189+ SqlString sqlString = expression . ToSqlString ( criteria , 0 , criteriaQuery ) ;
191190 string expectedSql = "sum(sql_alias.Pay) as y0_" ;
192191 CompareSqlStrings ( sqlString , expectedSql , 0 ) ;
193192 session . Close ( ) ;
0 commit comments