Skip to content

Commit d229631

Browse files
committed
Merge tag '4.0.3.GA'
2 parents 206d415 + 5c739ad commit d229631

24 files changed

+1111
-511
lines changed

build-common/common.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
effectively SP0).
6161
-->
6262

63-
<property name="project.version" value="4.0.2.GA" overwrite="false" />
63+
<property name="project.version" value="4.0.3.GA" overwrite="false" />
6464

6565
<!-- This version number should be changed if, but only if, there are incompatible
6666
changes compared to the previous version. -->

lib/teamcity/firebird/NHibernate.Test.last-results.xml

Lines changed: 50 additions & 21 deletions
Large diffs are not rendered by default.

lib/teamcity/mysql/NHibernate.Test.last-results.xml

Lines changed: 44 additions & 19 deletions
Large diffs are not rendered by default.

lib/teamcity/oracle/NHibernate.Test.last-results.xml

Lines changed: 60 additions & 31 deletions
Large diffs are not rendered by default.

lib/teamcity/sqlServerCe/NHibernate.Test.last-results.xml

Lines changed: 265 additions & 236 deletions
Large diffs are not rendered by default.

lib/teamcity/sqlServerOdbc/NHibernate.Test.last-results.xml

Lines changed: 137 additions & 107 deletions
Large diffs are not rendered by default.

releasenotes.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
Build 4.0.3.GA
2+
=============================
3+
4+
5+
** Bug
6+
* [NH-2504] - Can't use Cacheable with Group By
7+
* [NH-3457] - TemplatedViolatedConstraintNameExtracter.ExtractUsingTemplate calls Substring with wrong arguments
8+
* [NH-3468] - InvalidCastException when deleting entities containing uninitialized lazy components
9+
* [NH-3573] - Query cache statistics not updated when using MultiCriteria
10+
* [NH-3731] - Unable to serialize session after modifying the index of entities in a list
11+
112

213
Build 4.0.2.GA
314
=============================
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
6+
namespace NHibernate.Test.LazyComponentTest
7+
{
8+
public class Address
9+
{
10+
public virtual string Country { get; set; }
11+
public virtual string City { get; set; }
12+
}
13+
}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
using System.Collections;
2+
using NUnit.Framework;
3+
4+
namespace NHibernate.Test.LazyComponentTest
5+
{
6+
[TestFixture]
7+
public class LazyComponentTestFixture : TestCase
8+
{
9+
protected override IList Mappings
10+
{
11+
get { return new[] {"LazyComponentTest.Person.hbm.xml"}; }
12+
}
13+
14+
protected override string MappingsAssembly
15+
{
16+
get { return "NHibernate.Test"; }
17+
}
18+
19+
protected override void OnSetUp()
20+
{
21+
using (var s = OpenSession())
22+
using (var t = s.BeginTransaction())
23+
{
24+
var person = new Person
25+
{
26+
Name = "Gabor",
27+
Address = new Address
28+
{
29+
Country = "HUN",
30+
City = "Budapest"
31+
}
32+
};
33+
s.Persist(person);
34+
t.Commit();
35+
}
36+
}
37+
38+
protected override void OnTearDown()
39+
{
40+
using (var s = OpenSession())
41+
using (var t = s.BeginTransaction())
42+
{
43+
s.CreateQuery("delete from Person").ExecuteUpdate();
44+
t.Commit();
45+
}
46+
}
47+
48+
[Test]
49+
public void LazyLoadTest()
50+
{
51+
using (var s = OpenSession())
52+
using (var t = s.BeginTransaction())
53+
{
54+
var p = s.CreateQuery("from Person p where name='Gabor'").UniqueResult<Person>();
55+
// make sure component has not been initialized yet
56+
Assert.That(NHibernateUtil.IsPropertyInitialized(p, "Address"), Is.False);
57+
58+
t.Commit();
59+
}
60+
}
61+
62+
[Test]
63+
public void LazyDeleteTest()
64+
{
65+
using (var s = OpenSession())
66+
using (var t = s.BeginTransaction())
67+
{
68+
var p = s.CreateQuery("from Person p where name='Gabor'").UniqueResult<Person>();
69+
// make sure component has not been initialized yet
70+
Assert.That(NHibernateUtil.IsPropertyInitialized(p, "Address"), Is.False);
71+
s.Delete(p);
72+
t.Commit();
73+
}
74+
}
75+
76+
[Test]
77+
public void LazyUpdateTest()
78+
{
79+
using (var s = OpenSession())
80+
using (var t = s.BeginTransaction())
81+
{
82+
var p = s.CreateQuery("from Person p where name='Gabor'").UniqueResult<Person>();
83+
// make sure component has not been initialized yet
84+
Assert.That(!NHibernateUtil.IsPropertyInitialized(p, "Address"));
85+
86+
p.Address.City = "Baja";
87+
s.Update(p);
88+
89+
t.Commit();
90+
}
91+
using (var s = OpenSession())
92+
using (var t = s.BeginTransaction())
93+
{
94+
var p = s.CreateQuery("from Person p where name='Gabor'").UniqueResult<Person>();
95+
Assert.That(p.Address.City, Is.EqualTo("Baja"));
96+
97+
t.Commit();
98+
}
99+
}
100+
}
101+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
6+
namespace NHibernate.Test.LazyComponentTest
7+
{
8+
public class Person
9+
{
10+
public virtual string Name { get; set; }
11+
public virtual Address Address { get; set; }
12+
}
13+
}

0 commit comments

Comments
 (0)