@@ -625,7 +625,7 @@ public void Cast()
625
625
// 1) Has more then 1 argument
626
626
// 2) The argument separator is "as" (for the other function is ',' or ' ')
627
627
// 3) The ReturnType is not fixed (depend on a column type)
628
- // 4) The 2th argument is parsed by NH and traslated for a specific Dialect (can't be interpreted directly by RDBMS)
628
+ // 4) The 2th argument is parsed by NH and translated for a specific Dialect (can't be interpreted directly by RDBMS)
629
629
using ( ISession s = OpenSession ( ) )
630
630
{
631
631
Animal a1 = new Animal ( "abcdef" , 1.3f ) ;
@@ -643,7 +643,7 @@ public void Cast()
643
643
Assert . AreEqual ( 1 , l . Count ) ;
644
644
Assert . That ( l [ 0 ] , Is . TypeOf ( typeof ( double ) ) ) ;
645
645
646
- // Rendered in SELECT using a property in an operation with costant
646
+ // Rendered in SELECT using a property in an operation with constants
647
647
hql = "select cast(7+123-5*a.BodyWeight as Double) from Animal a" ;
648
648
l = s . CreateQuery ( hql ) . List ( ) ;
649
649
Assert . AreEqual ( 1 , l . Count ) ;
@@ -658,7 +658,7 @@ public void Cast()
658
658
Assert . That ( l [ 0 ] , Is . TypeOf ( typeof ( double ) ) ) ;
659
659
}
660
660
661
- // TODO: Rendered in SELECT using string costant assigned with critic chars (separators)
661
+ // TODO: Rendered in SELECT using string constant assigned with critic chars (separators)
662
662
663
663
// Rendered in WHERE using a property
664
664
if ( ! ( Dialect is Oracle8iDialect ) )
@@ -668,7 +668,7 @@ public void Cast()
668
668
Assert . AreEqual ( "abcdef" , result . Description ) ;
669
669
}
670
670
671
- // Rendered in WHERE using a property in an operation with costants
671
+ // Rendered in WHERE using a property in an operation with constants
672
672
hql = "from Animal a where cast(7+123-2*a.BodyWeight as Double)>0" ;
673
673
result = ( Animal ) s . CreateQuery ( hql ) . UniqueResult ( ) ;
674
674
Assert . AreEqual ( "abcdef" , result . Description ) ;
@@ -694,7 +694,7 @@ public void Cast()
694
694
Assert . AreEqual ( 1 , l . Count ) ;
695
695
Assert . That ( l [ 0 ] , Is . TypeOf ( typeof ( double ) ) ) ;
696
696
697
- // Rendered in GROUP BY using a property in an operation with costant
697
+ // Rendered in GROUP BY using a property in an operation with constants
698
698
hql = "select cast(7+123-5*a.BodyWeight as Double) from Animal a group by cast(7+123-5*a.BodyWeight as Double)" ;
699
699
l = s . CreateQuery ( hql ) . List ( ) ;
700
700
Assert . AreEqual ( 1 , l . Count ) ;
@@ -719,7 +719,7 @@ public void Cast()
719
719
Assert . AreEqual ( 1 , l . Count ) ;
720
720
Assert . That ( l [ 0 ] , Is . TypeOf ( typeof ( double ) ) ) ;
721
721
722
- // Rendered in HAVING using a property in an operation with costants
722
+ // Rendered in HAVING using a property in an operation with constants
723
723
hql =
724
724
"select cast(7+123.3-1*a.BodyWeight as int) from Animal a group by cast(7+123.3-1*a.BodyWeight as int) having cast(7+123.3-1*a.BodyWeight as int)>0" ;
725
725
l = s . CreateQuery ( hql ) . List ( ) ;
@@ -742,6 +742,9 @@ public void Cast()
742
742
}
743
743
catch ( ADOException ex )
744
744
{
745
+ if ( ex . InnerException == null )
746
+ throw ;
747
+
745
748
if ( Dialect is Oracle8iDialect )
746
749
{
747
750
if ( ! ex . InnerException . Message . StartsWith ( "ORA-00979" ) )
@@ -762,7 +765,7 @@ public void Cast()
762
765
// This test raises an exception in SQL Server because named
763
766
// parameters internally are always positional (@p0, @p1, etc.)
764
767
// and named differently hence they mismatch between GROUP BY and HAVING clauses.
765
- if ( ! ex . InnerException . Message . Equals ( msgToCheck ) )
768
+ if ( ! ex . InnerException . Message . Contains ( msgToCheck ) )
766
769
throw ;
767
770
}
768
771
}
0 commit comments