Skip to content

Commit 15898b8

Browse files
committed
Merge branch 'master' into db2
2 parents a150a17 + c52c7f1 commit 15898b8

File tree

121 files changed

+3139
-363
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+3139
-363
lines changed

.deepsource.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ version = 1
33
test_patterns = ["src/NHibernate.Test/**"]
44

55
exclude_patterns = [
6+
"src/NHibernate/**/*.generated.cs",
67
"src/NHibernate/Async/**/*.cs",
78
"src/NHibernate.DomainModel/Async/**/*.cs",
89
"src/NHibernate.Test/Async/**/*.cs"
910
]
1011

1112
[[analyzers]]
12-
name = "csharp"
13-
enabled = true
13+
name = "csharp"

.github/renovate.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
"Oracle.ManagedDataAccess"
3636
],
3737
"groupName": "Oracle.ManagedDataAccess"
38+
},
39+
{
40+
"matchPackagePrefixes": [
41+
"NHibernate.Caches"
42+
],
43+
"groupName": "NHibernate.Caches"
3844
}
3945
]
4046
}

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Nightly Development Builds
2626
--------------------------
2727

2828
The quickest way to get the latest development build of NHibernate is to add it to your project using
29-
NuGet from MyGet feed (<https://www.myget.org/gallery/nhibernate>).
29+
NuGet from Cloudsmith feed (<https://cloudsmith.io/~nhibernate/repos/nhibernate-core/packages/>).
3030

3131
In order to make life a little bit easier you can register the package source in the NuGet.Config
3232
file in the top folder of your project, similar to the following.
@@ -35,11 +35,18 @@ file in the top folder of your project, similar to the following.
3535
<?xml version="1.0" encoding="utf-8"?>
3636
<configuration>
3737
<packageSources>
38-
<add key="NHibernateDevBuilds" value="https://www.myget.org/F/nhibernate/api/v3/index.json" />
38+
<add key="NHibernateDevBuilds" value="https://nuget.cloudsmith.io/nhibernate/nhibernate-core/v3/index.json" />
3939
</packageSources>
4040
</configuration>
4141
```
4242

43+
Package repository hosting is graciously provided by [Cloudsmith](https://cloudsmith.com).
44+
Cloudsmith is the only fully hosted, cloud-native, universal package management solution, that
45+
enables your organization to create, store and share packages in any format, to any place, with total
46+
confidence.
47+
48+
[![Hosted By: Cloudsmith](https://img.shields.io/badge/OSS%20hosting%20by-cloudsmith-blue?logo=cloudsmith&style=flat-square)](https://cloudsmith.com)
49+
4350
Community Forums
4451
----------------
4552

doc/reference/modules/basic_mapping.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2385,6 +2385,7 @@
23852385
<area id="onetoone9" coords="10 60"/>
23862386
<area id="onetoone10" coords="11 60"/>
23872387
<area id="onetoone11" coords="12 60"/>
2388+
<area id="onetoone12" coords="13 60"/>
23882389
</areaspec>
23892390
<programlisting><![CDATA[<one-to-one
23902391
name="propertyName"
@@ -2398,6 +2399,7 @@
23982399
formula="any SQL expression"
23992400
entity-name="entityName"
24002401
foreign-key="foreignKeyName"
2402+
optimistic-lock="true|false"
24012403
/>]]></programlisting>
24022404
<calloutlist>
24032405
<callout arearefs="onetoone1">
@@ -2471,12 +2473,20 @@
24712473
<literal>entity-name</literal> (optional): The entity name of the associated class.
24722474
</para>
24732475
</callout>
2474-
<callout arearefs="manytoone11">
2476+
<callout arearefs="onetoone11">
24752477
<para>
24762478
<literal>foreign-key</literal> (optional): Specifies the name of the foreign key
24772479
constraint for DDL generation.
24782480
</para>
24792481
</callout>
2482+
<callout arearefs="onetoone12">
2483+
<para>
2484+
<literal>optimistic-lock</literal> (optional - defaults to <literal>true</literal>):
2485+
Specifies that updates to this property do or do not require acquisition of the
2486+
optimistic lock. In other words, determines if a version increment should occur when
2487+
this property is dirty.
2488+
</para>
2489+
</callout>
24802490
</calloutlist>
24812491
</programlistingco>
24822492

doc/reference/modules/configuration.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1728,7 +1728,7 @@ in the parameter binding.</programlisting>
17281728
Use the assembly qualified class name of a custom <literal>IObjectsFactory</literal>
17291729
implementation.
17301730
</para>
1731-
<programlisting><![CDATA[<bytecode-provider
1731+
<programlisting><![CDATA[<objects-factory
17321732
type="className" />]]></programlisting>
17331733
<para>
17341734
You can also set this property by code by setting

releasenotes.txt

Lines changed: 91 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,50 @@
1-
Build 5.4.0
1+
Build 5.4.2
2+
=============================
3+
4+
Release notes - NHibernate - Version 5.4.2
5+
6+
6 issues were resolved in this release.
7+
8+
** Bug
9+
10+
* #3274 Improve LINQ Contains subquery parameter detection
11+
* #3271 LINQ subqueries wrongly altered by SelectClauseVisitor
12+
* #3263 Wrong alias in Where clause if using Fetch and scalar Select
13+
* #3239 Incorrect SQL generated fetching many-to-many with subclasses
14+
15+
** New Feature
16+
17+
* #3251 MappingByCode: Support backfield property access
18+
19+
** Task
20+
21+
* #3281 Merge 5.3.16 in 5.4.x
22+
* #3277 Release 5.4.2
23+
24+
25+
Build 5.4.1
26+
=============================
27+
28+
Release notes - NHibernate - Version 5.4.1
29+
30+
5 issues were resolved in this release.
31+
32+
** Bug
33+
34+
* #3216 Enable one-to-one optimistic lock handling in mapping
35+
* #3215 Count(Distinct ...) does not work
36+
* #3203 Fix a wrong example in configuration documentation
37+
38+
** Task
39+
40+
* #3232 Release 5.4.1
41+
* #3227 Merge 5.3.15 in 5.4.x
42+
43+
As part of releasing 5.4.1, a missing 5.4.0 possible breaking change has been added, about
44+
one-to-one associations and optimistic locking. See 5.4.0 possible breaking changes.
45+
46+
47+
Build 5.4.0
248
=============================
349

450
Release notes - NHibernate - Version 5.4.0
@@ -12,6 +58,8 @@ Release notes - NHibernate - Version 5.4.0
1258
* 201 issues were resolved in this release.
1359

1460
##### Possible Breaking Changes #####
61+
* One-to-one changes does now trigger a version increment, consistently with the default behavior of other kinds of
62+
associations. See #3204.
1563
* Linq and criteria queries on unmapped entities will throw instead of returning an empty result list. See #1106, #1095.
1664
* The second level cache UpdateTimestampsCache does not use locks anymore. This may slightly increase the number of cases
1765
where stale data is returned by the query cache. See #2742.
@@ -186,6 +234,41 @@ Release notes - NHibernate - Version 5.4.0
186234
* #2242 Test case for NH-3972 - SQL error when selecting a column of a subclass when sibling classes have a column of the same name
187235

188236

237+
Build 5.3.16
238+
=============================
239+
240+
Release notes - NHibernate - Version 5.3.16
241+
242+
3 issues were resolved in this release.
243+
244+
** Bug
245+
246+
* #3269 "Or" clause in a "where" condition returns a wrong result with not-found-ignore
247+
* #3210 Wrong name value for L2 read-only cache warning on mutable
248+
249+
** Task
250+
251+
* #3276 Release 5.3.16
252+
253+
254+
Build 5.3.15
255+
=============================
256+
257+
Release notes - NHibernate - Version 5.3.15
258+
259+
4 issues were resolved in this release.
260+
261+
** Bug
262+
263+
* #3218 Failure of contains subquery with parameter
264+
* #3187 Fix mixing implied implicit and left joins in HQL for v5.3
265+
266+
** Task
267+
268+
* #3225 Release 5.3.15
269+
* #3222 Automatically generate async code on pull requests for 5.3
270+
271+
189272
Build 5.3.14
190273
=============================
191274

@@ -195,8 +278,8 @@ Release notes - NHibernate - Version 5.3.14
195278

196279
** Bug
197280

198-
#3169 InvalidOperationException: This transformer is not initialized by Cached Query
199-
#3164 Fetching a lazy loaded component regression
281+
* #3169 InvalidOperationException: This transformer is not initialized by Cached Query
282+
* #3164 Fetching a lazy loaded component regression
200283

201284
** Task
202285

@@ -212,14 +295,14 @@ Release notes - NHibernate - Version 5.3.13
212295

213296
** Bug
214297

215-
#3134 ManyToMany - Tries to select not existing column in Mapping Table
216-
#3113 Join fails on Oracle9Dialect
217-
#3030 Memory leak named parameter holds entity references
298+
* #3134 ManyToMany - Tries to select not existing column in Mapping Table
299+
* #3113 Join fails on Oracle9Dialect
300+
* #3030 Memory leak named parameter holds entity references
218301

219302
** Improvement
220303

221-
#3120 Guards against use of a disposed session factory
222-
#2994 Npgsql 6 is not compatible
304+
* #3120 Guards against use of a disposed session factory
305+
* #2994 Npgsql 6 is not compatible
223306

224307
** Task
225308

src/NHibernate.Test/Async/Hql/Ast/HqlFixture.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,17 @@ public async Task MultipleParametersInCaseStatementAsync()
141141
}
142142
}
143143

144+
[Test]
145+
public async Task ParametersInCaseThenClauseAsync()
146+
{
147+
using ISession s = OpenSession();
148+
var result = await (s.CreateQuery("select a from Animal a where (case when 2=2 then ? else ? end) = 1")
149+
.SetParameter(0, 1)
150+
.SetParameter(1, 0)
151+
.UniqueResultAsync());
152+
Assert.AreEqual(null, result);
153+
}
154+
144155
[Test]
145156
public async Task ParameterInCaseThenClauseAsync()
146157
{

src/NHibernate.Test/Async/Hql/EntityJoinHqlTest.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,18 @@ from x2 in session.Query<NullableOwner>()
358358
//GH-2988
359359
var withNullOrValidList = await (session.Query<NullableOwner>().Where(x => x.ManyToOne.Id == validManyToOne.Id || x.ManyToOne == null).ToListAsync());
360360
var withNullOrValidList2 = await (session.Query<NullableOwner>().Where(x => x.ManyToOne == null || x.ManyToOne.Id == validManyToOne.Id).ToListAsync());
361+
//GH-3269
362+
var invalidId = Guid.NewGuid();
363+
var withInvalidOrValid = await (session.Query<NullableOwner>().Where(x => x.OneToOne.Id == invalidId || x.ManyToOne.Id == validManyToOne.Id).ToListAsync());
364+
var withInvalidOrNull = await (session.Query<NullableOwner>().Where(x => x.ManyToOne.Id == invalidId || x.OneToOne == null).ToListAsync());
365+
var withInvalidOrNotNull = await (session.Query<NullableOwner>().Where(x => x.ManyToOne.Id == invalidId || x.OneToOne != null).ToListAsync());
366+
367+
Assert.That(withInvalidOrValid.Count, Is.EqualTo(1));
368+
Assert.That(withInvalidOrNull.Count, Is.EqualTo(2));
369+
Assert.That(withInvalidOrNotNull.Count, Is.EqualTo(0));
370+
371+
//GH-3185
372+
var mixImplicitAndLeftJoinList = await (session.Query<NullableOwner>().Where(x => x.ManyToOne.Id == validManyToOne.Id && x.OneToOne == null).ToListAsync());
361373

362374
Assert.That(fullList.Count, Is.EqualTo(2));
363375
Assert.That(withValidManyToOneList.Count, Is.EqualTo(0));
@@ -366,6 +378,7 @@ from x2 in session.Query<NullableOwner>()
366378
Assert.That(withNullManyToOneJoinedList.Count, Is.EqualTo(2));
367379
Assert.That(withNullOrValidList.Count, Is.EqualTo(2));
368380
Assert.That(withNullOrValidList2.Count, Is.EqualTo(2));
381+
Assert.That(mixImplicitAndLeftJoinList.Count, Is.EqualTo(1));
369382
}
370383
}
371384

src/NHibernate.Test/Async/Linq/EnumTests.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,11 @@ public async Task ConditionalNavigationPropertyAsync()
174174
}
175175
}
176176

177-
[Test]
178-
public async Task CanQueryComplexExpressionOnTestEnumAsync()
177+
[TestCase(null)]
178+
[TestCase(TestEnum.Unspecified)]
179+
public async Task CanQueryComplexExpressionOnTestEnumAsync(TestEnum? type)
179180
{
180-
//TODO: Fix issue on SQLite with type set to TestEnum.Unspecified
181-
TestEnum? type = null;
182181
using (var session = OpenSession())
183-
using (var trans = session.BeginTransaction())
184182
{
185183
var entities = session.Query<EnumEntity>();
186184

@@ -197,7 +195,7 @@ public async Task CanQueryComplexExpressionOnTestEnumAsync()
197195
coalesce = user.NullableEnum1 ?? TestEnum.Medium
198196
}).ToListAsync());
199197

200-
Assert.That(query.Count, Is.EqualTo(0));
198+
Assert.That(query.Count, Is.EqualTo(type == TestEnum.Unspecified ? 1 : 0));
201199
}
202200
}
203201

src/NHibernate.Test/Async/Linq/FunctionTests.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,33 @@ where item.Discount.Equals(-1)
459459
await (ObjectDumper.WriteAsync(query));
460460
}
461461

462+
[Test]
463+
public async Task WhereEnumEqualAsync()
464+
{
465+
var query = from item in db.PatientRecords
466+
where item.Gender.Equals(Gender.Female)
467+
select item;
468+
469+
await (ObjectDumper.WriteAsync(query));
470+
471+
query = from item in db.PatientRecords
472+
where item.Gender.Equals(item.Gender)
473+
select item;
474+
475+
await (ObjectDumper.WriteAsync(query));
476+
}
477+
478+
479+
[Test]
480+
public async Task WhereObjectEqualAsync()
481+
{
482+
var query = from item in db.PatientRecords
483+
where ((object) item.Gender).Equals(Gender.Female)
484+
select item;
485+
486+
await (ObjectDumper.WriteAsync(query));
487+
}
488+
462489
[Test]
463490
public async Task WhereEquatableEqualAsync()
464491
{

0 commit comments

Comments
 (0)