@@ -18,7 +18,7 @@ static HQLFunctions()
18
18
notSupportedStandardFunction =
19
19
new Hashtable
20
20
{
21
- { "locate" , new [ ] { typeof ( FirebirdDialect ) , typeof ( PostgreSQLDialect ) , typeof ( SQLiteDialect ) } } ,
21
+ { "locate" , new [ ] { typeof ( SQLiteDialect ) } } ,
22
22
{ "bit_length" , new [ ] { typeof ( SQLiteDialect ) } } ,
23
23
{ "extract" , new [ ] { typeof ( SQLiteDialect ) } } ,
24
24
{ "nullif" , new [ ] { typeof ( Oracle8iDialect ) } }
@@ -83,12 +83,12 @@ public void AggregateCount()
83
83
Assert . AreEqual ( 2 , result ) ;
84
84
85
85
// Count in where
86
- if ( TestDialect . SupportsHavingWithoutGroupBy )
87
- {
88
- result = s . CreateQuery ( "select count(a.id) from Animal a having count(a.id)>1" ) . UniqueResult ( ) ;
89
- Assert . AreEqual ( typeof ( long ) , result . GetType ( ) ) ;
90
- Assert . AreEqual ( 2 , result ) ;
91
- }
86
+ if ( TestDialect . SupportsHavingWithoutGroupBy )
87
+ {
88
+ result = s . CreateQuery ( "select count(a.id) from Animal a having count(a.id)>1" ) . UniqueResult ( ) ;
89
+ Assert . AreEqual ( typeof ( long ) , result . GetType ( ) ) ;
90
+ Assert . AreEqual ( 2 , result ) ;
91
+ }
92
92
}
93
93
}
94
94
@@ -111,12 +111,12 @@ public void AggregateAvg()
111
111
Assert . AreEqual ( 15D , result ) ;
112
112
113
113
// In where
114
- if ( TestDialect . SupportsHavingWithoutGroupBy )
115
- {
116
- result = s . CreateQuery ( "select avg(a.BodyWeight) from Animal a having avg(a.BodyWeight)>0" ) . UniqueResult ( ) ;
117
- Assert . AreEqual ( typeof ( double ) , result . GetType ( ) ) ;
118
- Assert . AreEqual ( 15D , result ) ;
119
- }
114
+ if ( TestDialect . SupportsHavingWithoutGroupBy )
115
+ {
116
+ result = s . CreateQuery ( "select avg(a.BodyWeight) from Animal a having avg(a.BodyWeight)>0" ) . UniqueResult ( ) ;
117
+ Assert . AreEqual ( typeof ( double ) , result . GetType ( ) ) ;
118
+ Assert . AreEqual ( 15D , result ) ;
119
+ }
120
120
}
121
121
}
122
122
@@ -137,12 +137,12 @@ public void AggregateMax()
137
137
Assert . AreEqual ( typeof ( float ) , result . GetType ( ) ) ; //use column type
138
138
Assert . AreEqual ( 20F , result ) ;
139
139
140
- if ( TestDialect . SupportsHavingWithoutGroupBy )
141
- {
142
- result = s . CreateQuery ( "select max(a.BodyWeight) from Animal a having max(a.BodyWeight)>0" ) . UniqueResult ( ) ;
143
- Assert . AreEqual ( typeof ( float ) , result . GetType ( ) ) ; //use column type
144
- Assert . AreEqual ( 20F , result ) ;
145
- }
140
+ if ( TestDialect . SupportsHavingWithoutGroupBy )
141
+ {
142
+ result = s . CreateQuery ( "select max(a.BodyWeight) from Animal a having max(a.BodyWeight)>0" ) . UniqueResult ( ) ;
143
+ Assert . AreEqual ( typeof ( float ) , result . GetType ( ) ) ; //use column type
144
+ Assert . AreEqual ( 20F , result ) ;
145
+ }
146
146
}
147
147
}
148
148
@@ -163,12 +163,12 @@ public void AggregateMin()
163
163
Assert . AreEqual ( typeof ( float ) , result . GetType ( ) ) ; //use column type
164
164
Assert . AreEqual ( 10F , result ) ;
165
165
166
- if ( TestDialect . SupportsHavingWithoutGroupBy )
167
- {
168
- result = s . CreateQuery ( "select min(a.BodyWeight) from Animal a having min(a.BodyWeight)>0" ) . UniqueResult ( ) ;
169
- Assert . AreEqual ( typeof ( float ) , result . GetType ( ) ) ; //use column type
170
- Assert . AreEqual ( 10F , result ) ;
171
- }
166
+ if ( TestDialect . SupportsHavingWithoutGroupBy )
167
+ {
168
+ result = s . CreateQuery ( "select min(a.BodyWeight) from Animal a having min(a.BodyWeight)>0" ) . UniqueResult ( ) ;
169
+ Assert . AreEqual ( typeof ( float ) , result . GetType ( ) ) ; //use column type
170
+ Assert . AreEqual ( 10F , result ) ;
171
+ }
172
172
}
173
173
}
174
174
@@ -189,12 +189,12 @@ public void AggregateSum()
189
189
Assert . AreEqual ( typeof ( double ) , result . GetType ( ) ) ;
190
190
Assert . AreEqual ( 30D , result ) ;
191
191
192
- if ( TestDialect . SupportsHavingWithoutGroupBy )
193
- {
194
- result = s . CreateQuery ( "select sum(a.BodyWeight) from Animal a having sum(a.BodyWeight)>0" ) . UniqueResult ( ) ;
195
- Assert . AreEqual ( typeof ( double ) , result . GetType ( ) ) ;
196
- Assert . AreEqual ( 30D , result ) ;
197
- }
192
+ if ( TestDialect . SupportsHavingWithoutGroupBy )
193
+ {
194
+ result = s . CreateQuery ( "select sum(a.BodyWeight) from Animal a having sum(a.BodyWeight)>0" ) . UniqueResult ( ) ;
195
+ Assert . AreEqual ( typeof ( double ) , result . GetType ( ) ) ;
196
+ Assert . AreEqual ( 30D , result ) ;
197
+ }
198
198
}
199
199
}
200
200
@@ -261,9 +261,9 @@ public void SubStringTwoParameters()
261
261
{
262
262
hql = "from Animal a where substring(concat(a.Description, ?), :start) = 'deffoo'" ;
263
263
result = ( Animal ) s . CreateQuery ( hql )
264
- . SetParameter ( 0 , "foo" )
265
- . SetParameter ( "start" , 4 )
266
- . UniqueResult ( ) ;
264
+ . SetParameter ( 0 , "foo" )
265
+ . SetParameter ( "start" , 4 )
266
+ . UniqueResult ( ) ;
267
267
Assert . AreEqual ( "abcdef" , result . Description ) ;
268
268
}
269
269
}
0 commit comments