@@ -345,8 +345,7 @@ public void MoveLazyCollection()
345
345
Assert . IsFalse ( NHibernateUtil . IsInitialized ( baz . FooSet ) ) ;
346
346
Assert . AreEqual ( 0 , baz . FooSet . Count ) ;
347
347
348
- // TODO: batching doesn't work in NH yet
349
- //Assert.IsTrue( NHibernateUtil.IsInitialized( baz2.FooSet ) ); //fooSet has batching enabled
348
+ Assert . IsTrue ( NHibernateUtil . IsInitialized ( baz2 . FooSet ) ) ; //FooSet has batching enabled
350
349
351
350
Assert . AreEqual ( 1 , baz2 . FooSet . Count ) ;
352
351
@@ -460,7 +459,7 @@ public void Query()
460
459
461
460
s . CreateQuery ( "from bar in class Bar, foo in elements(bar.Baz.FooArray)" ) . List ( ) ;
462
461
463
- if ( dialect is DB2Dialect )
462
+ if ( Dialect is DB2Dialect )
464
463
{
465
464
s . CreateQuery ( "from foo in class Foo where lower( foo.TheFoo.String ) = 'foo'" ) . List ( ) ;
466
465
s . CreateQuery ( "from foo in class Foo where lower( (foo.TheFoo.String || 'foo') || 'bar' ) = 'foo'" ) . List ( ) ;
@@ -473,7 +472,7 @@ public void Query()
473
472
. List ( ) ;
474
473
}
475
474
476
- if ( ( dialect is SybaseDialect ) || ( dialect is MsSql2000Dialect ) )
475
+ if ( ( Dialect is SybaseDialect ) || ( Dialect is MsSql2000Dialect ) )
477
476
{
478
477
s . CreateQuery ( "select baz from Baz as baz join baz.FooArray foo group by baz order by sum(foo.Float)" ) . Enumerable ( ) ;
479
478
}
@@ -510,9 +509,9 @@ public void Query()
510
509
foo . TheFoo . TheFoo = foo ;
511
510
foo . String = "fizard" ;
512
511
513
- if ( dialect . SupportsSubSelects )
512
+ if ( Dialect . SupportsSubSelects )
514
513
{
515
- if ( ! ( dialect is FirebirdDialect ) )
514
+ if ( ! ( Dialect is FirebirdDialect ) )
516
515
{
517
516
list =
518
517
s . CreateQuery ( "from foo in class NHibernate.DomainModel.Foo where ? = some foo.Component.ImportantDates.elements" )
@@ -615,7 +614,7 @@ public void Query()
615
614
"select foo.TheFoo.TheFoo.TheFoo from foo in class Foo, foo2 in class Foo where"
616
615
+ " foo = foo2.TheFoo and not not ( not foo.String='fizard' )"
617
616
+ " and foo2.String between 'a' and (foo.TheFoo.String)"
618
- + ( dialect is SQLiteDialect
617
+ + ( Dialect is SQLiteDialect
619
618
? " and ( foo2.String in ( 'fiz', 'blah') or 1=1 )"
620
619
: " and ( foo2.String in ( 'fiz', 'blah', foo.TheFoo.String, foo.String, foo2.String ) )" )
621
620
) . List ( ) ;
@@ -802,7 +801,7 @@ public void Query()
802
801
. List ( ) ;
803
802
804
803
s . CreateQuery ( "from Baz baz inner join baz.CollectionComponent.Nested.Foos foo where foo.String is null" ) . List ( ) ;
805
- if ( dialect . SupportsSubSelects )
804
+ if ( Dialect . SupportsSubSelects )
806
805
{
807
806
s . CreateQuery ( "from Baz baz inner join baz.FooSet where '1' in (from baz.FooSet foo where foo.String is not null)" ) .
808
807
List ( ) ;
@@ -1090,7 +1089,7 @@ public void QueryCollectionOfValues()
1090
1089
Glarch g = new Glarch ( ) ;
1091
1090
gid = s . Save ( g ) ;
1092
1091
1093
- if ( dialect . SupportsSubSelects )
1092
+ if ( Dialect . SupportsSubSelects )
1094
1093
{
1095
1094
s . CreateFilter ( baz . FooArray , "where size(this.Bytes) > 0" ) . List ( ) ;
1096
1095
s . CreateFilter ( baz . FooArray , "where 0 in elements(this.Bytes)" ) . List ( ) ;
@@ -2103,8 +2102,6 @@ public void FindByCriteria()
2103
2102
s . Flush ( ) ;
2104
2103
s . Close ( ) ;
2105
2104
2106
- //TODO: some HSQLDialect specific code here
2107
-
2108
2105
s = OpenSession ( ) ;
2109
2106
list = s . CreateCriteria ( typeof ( Foo ) )
2110
2107
. Add ( Expression . Expression . Eq ( "Integer" , f . Integer ) )
@@ -2264,8 +2261,6 @@ public void AssociationId()
2264
2261
stuf . Foo = bar ;
2265
2262
stuf . Id = 1234 ;
2266
2263
2267
- //TODO: http://jira.nhibernate.org:8080/browse/NH-88
2268
- //stuf.setProperty(TimeZone.getDefault() );
2269
2264
s . Save ( more ) ;
2270
2265
t . Commit ( ) ;
2271
2266
}
@@ -2348,9 +2343,6 @@ public void AssociationId()
2348
2343
stuff . MoreStuff = more ;
2349
2344
s . Load ( stuff , stuff ) ;
2350
2345
2351
- // TODO: figure out what to do with TimeZone
2352
- // http://jira.nhibernate.org:8080/browse/NH-88
2353
- //Assert.IsTrue( stuff.getProperty().equals( TimeZone.getDefault() ) );
2354
2346
Assert . AreEqual ( "More Stuff" , stuff . MoreStuff . Name ) ;
2355
2347
s . Delete ( "from ms in class MoreStuff" ) ;
2356
2348
s . Delete ( "from foo in class Foo" ) ;
@@ -2399,7 +2391,7 @@ public void CompositeKeyPathExpressions()
2399
2391
hql = "from fum1 in class Fum where fum1.Fo.FumString is not null order by fum1.Fo.FumString" ;
2400
2392
s . CreateQuery ( hql ) . List ( ) ;
2401
2393
2402
- if ( dialect . SupportsSubSelects )
2394
+ if ( Dialect . SupportsSubSelects )
2403
2395
{
2404
2396
hql = "from fum1 in class Fum where size(fum1.Friends) = 0" ;
2405
2397
s . CreateQuery ( hql ) . List ( ) ;
@@ -2465,15 +2457,9 @@ public void CollectionsInSelect()
2465
2457
Assert . AreEqual ( baz . Name , r . Name ) ;
2466
2458
Assert . AreEqual ( 1 , r . Count ) ;
2467
2459
2468
- // TODO: figure out a better way
2469
- // in hibernate this is hard coded as 696969696969696938l which is very dependant upon
2470
- // how the test are run because it is calculated on a global static variable...
2471
- // maybe a better way to test this would be to assume that the first
2472
- //Assert.AreEqual( 696969696969696969L, r.Amount );
2473
-
2474
2460
s . CreateQuery ( "select max( elements(bar.Baz.FooArray) ) from Bar as bar" ) . List ( ) ;
2475
2461
// the following test is disable for databases with no subselects... also for Interbase (not sure why) - comment from h2.0.3
2476
- if ( dialect . SupportsSubSelects )
2462
+ if ( Dialect . SupportsSubSelects )
2477
2463
{
2478
2464
s . CreateQuery ( "select count(*) from Baz as baz where 1 in indices(baz.FooArray)" ) . List ( ) ;
2479
2465
s . CreateQuery ( "select count(*) from Bar as bar where 'abc' in elements(bar.Baz.FooArray)" ) . List ( ) ;
@@ -2491,7 +2477,7 @@ public void CollectionsInSelect()
2491
2477
. List ( ) ;
2492
2478
2493
2479
// TODO: figure out why this is throwing an ORA-1722 error
2494
- if ( ! ( dialect is Oracle9Dialect ) )
2480
+ if ( ! ( Dialect is Oracle9Dialect ) )
2495
2481
{
2496
2482
s . CreateQuery (
2497
2483
"select count(*) from Bar as bar left outer join bar.Component.Glarch.ProxyArray as pg where 1 in (from g in bar.Component.Glarch.ProxyArray)" )
@@ -2615,7 +2601,9 @@ public void NewFlushing()
2615
2601
IList newList = new ArrayList ( ) ;
2616
2602
newList . Add ( "value" ) ;
2617
2603
baz . StringList = newList ;
2618
- enumer = s . CreateQuery ( "from foo in class Foo" ) . Enumerable ( ) . GetEnumerator ( ) ; //no flush
2604
+
2605
+ s . CreateQuery ( "from foo in class Foo" ) . Enumerable ( ) . GetEnumerator ( ) ; //no flush
2606
+
2619
2607
baz . StringList = null ;
2620
2608
enumer = s . CreateQuery ( "select baz.StringList.elements from baz in class Baz" ) . Enumerable ( ) . GetEnumerator ( ) ;
2621
2609
Assert . IsFalse ( enumer . MoveNext ( ) ) ;
@@ -2669,7 +2657,7 @@ public void PersistCollections()
2669
2657
IList list ;
2670
2658
2671
2659
// disable this for dbs with no subselects
2672
- if ( dialect . SupportsSubSelects )
2660
+ if ( Dialect . SupportsSubSelects )
2673
2661
{
2674
2662
list =
2675
2663
s . CreateQuery (
@@ -2832,10 +2820,10 @@ public void PersistCollections()
2832
2820
s . Delete ( baz . TopGlarchez [ 'H' ] ) ;
2833
2821
2834
2822
IDbCommand cmd = s . Connection . CreateCommand ( ) ;
2835
- cmd . CommandText = "update " + dialect . QuoteForTableName ( "glarchez" ) + " set baz_map_id=null where baz_map_index='a'" ;
2823
+ cmd . CommandText = "update " + Dialect . QuoteForTableName ( "glarchez" ) + " set baz_map_id=null where baz_map_index='a'" ;
2836
2824
int rows = cmd . ExecuteNonQuery ( ) ;
2837
2825
Assert . AreEqual ( 1 , rows ) ;
2838
- Assert . AreEqual ( 1 , s . Delete ( "from bar in class NHibernate.DomainModel.Bar" ) ) ;
2826
+ Assert . AreEqual ( 2 , s . Delete ( "from bar in class NHibernate.DomainModel.Bar" ) ) ;
2839
2827
FooProxy [ ] arr = baz . FooArray ;
2840
2828
Assert . AreEqual ( 4 , arr . Length ) ;
2841
2829
Assert . AreEqual ( foo . Key , arr [ 1 ] . Key ) ;
@@ -3154,7 +3142,7 @@ public void CollectionOfSelf()
3154
3142
Assert . IsTrue ( bar . Abstracts . Contains ( bar ) , "collection contains self" ) ;
3155
3143
Assert . AreSame ( bar , bar . TheFoo , "association to self" ) ;
3156
3144
3157
- if ( dialect is MySQLDialect )
3145
+ if ( Dialect is MySQLDialect )
3158
3146
{
3159
3147
// Break the self-reference cycle to avoid error when deleting the row
3160
3148
bar . TheFoo = null ;
@@ -3866,7 +3854,7 @@ public void RecursiveLoad()
3866
3854
3867
3855
private bool DialectSupportsCountDistinct
3868
3856
{
3869
- get { return ! ( dialect is SQLiteDialect ) ; }
3857
+ get { return ! ( Dialect is SQLiteDialect ) ; }
3870
3858
}
3871
3859
3872
3860
[ Test ]
@@ -4746,7 +4734,7 @@ public void Refresh()
4746
4734
s . Flush ( ) ;
4747
4735
4748
4736
IDbCommand cmd = s . Connection . CreateCommand ( ) ;
4749
- cmd . CommandText = "update " + dialect . QuoteForTableName ( "foos" ) + " set long_ = -3" ;
4737
+ cmd . CommandText = "update " + Dialect . QuoteForTableName ( "foos" ) + " set long_ = -3" ;
4750
4738
cmd . ExecuteNonQuery ( ) ;
4751
4739
4752
4740
s . Refresh ( foo ) ;
@@ -4770,10 +4758,10 @@ public void RefreshTransient()
4770
4758
4771
4759
s = OpenSession ( ) ;
4772
4760
IDbCommand cmd = s . Connection . CreateCommand ( ) ;
4773
- cmd . CommandText = "update " + dialect . QuoteForTableName ( "foos" ) + " set long_ = -3" ;
4761
+ cmd . CommandText = "update " + Dialect . QuoteForTableName ( "foos" ) + " set long_ = -3" ;
4774
4762
cmd . ExecuteNonQuery ( ) ;
4775
4763
s . Refresh ( foo ) ;
4776
- Assert . AreEqual ( ( long ) - 3 , foo . Long ) ;
4764
+ Assert . AreEqual ( - 3L , foo . Long ) ;
4777
4765
s . Delete ( foo ) ;
4778
4766
s . Flush ( ) ;
4779
4767
s . Close ( ) ;
@@ -4795,7 +4783,7 @@ public void AutoFlush()
4795
4783
s = OpenSession ( ) ;
4796
4784
foo = ( FooProxy ) s . Load ( typeof ( Foo ) , foo . Key ) ;
4797
4785
4798
- if ( dialect . SupportsSubSelects )
4786
+ if ( Dialect . SupportsSubSelects )
4799
4787
{
4800
4788
foo . Bytes = GetBytes ( "osama" ) ;
4801
4789
Assert . AreEqual ( 1 ,
@@ -4919,7 +4907,7 @@ public void AutoFlushCollections()
4919
4907
GetEnumerator ( ) ;
4920
4908
Assert . IsTrue ( e . MoveNext ( ) ) ;
4921
4909
4922
- if ( dialect . SupportsSubSelects && ! ( dialect is FirebirdDialect ) )
4910
+ if ( Dialect . SupportsSubSelects && ! ( Dialect is FirebirdDialect ) )
4923
4911
{
4924
4912
baz . FooArray [ 0 ] = null ;
4925
4913
e = s . CreateQuery ( "from baz in class NHibernate.DomainModel.Baz where ? in baz.FooArray.elements" )
@@ -5510,4 +5498,4 @@ public void ParameterInOrderByClause()
5510
5498
5511
5499
#endregion
5512
5500
}
5513
- }
5501
+ }
0 commit comments