Skip to content

Commit 223412c

Browse files
authored
Merge branch 'master' into GH-1381
2 parents bf14184 + 2345bb4 commit 223412c

File tree

403 files changed

+9580
-4124
lines changed

Some content is hidden

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

403 files changed

+9580
-4124
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ current-test-configuration
1313
NHibernate.dll
1414
TestResult.xml
1515
.vscode
16+
.DS_Store

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: csharp
22
mono: latest
3-
dotnet: 2.1.2
3+
dotnet: 2.1.300
44
sudo: required
55
services:
66
- mysql

CONTRIBUTING.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Visit [https://github.com/nhibernate/nhibernate-core/issues][1] and search for y
1212

1313
Before creating an issue, please do your best to verify the existence of the problem. This reduces noise in the issue tracker and helps conserve the resources of the team for more useful tasks. Note the issue number for future steps.
1414

15+
If you are familiar with NHibernate inner working and want to directly fix the issue, you may also contribute a PR without writing a separated issue, provided you describe the fixed issue in the PR.
16+
1517
## Fork and Clone from GitHub
1618

1719
The main GitHub repository is at [https://github.com/nhibernate/nhibernate-core][2]. If you plan to contribute your test case or improvement back to NHibernate, you should visit that page and fork the repository so you can commit your own changes and then submit a pull request.
@@ -44,10 +46,11 @@ The main GitHub repository is at [https://github.com/nhibernate/nhibernate-core]
4446
In most cases, you will be adding your test to the NHibernate.Test project. If there is a test that only works with VisualBasic, then add it to the NHibernate.Test.VisualBasic project instead.
4547

4648
1. Open **NHibernate.sln** from the src folder.
47-
2. If adding a C# test, go to the NHSpecificTest folder in the NHibernate.Test project. If adding a VisualBasic test, go to the Issues folder in the NHibernate.Test.VisualBasic project.
48-
3. Copy and paste the GH0000 folder to create a duplicate test ("Copy of GH0000").
49-
4. Replace the four instances of GH0000 with your issue number.
50-
5. Edit the test as you see fit. Don't commit yet; there are details in a later step.
49+
2. If adding a VisualBasic test, go to the Issues folder in the NHibernate.Test.VisualBasic project. If adding a C# test, go to the NHibernate.Test project.
50+
3. C# only: either find the suitable feature folder and add your test there without following the two next points, or go to the NHSpecificTest folder.
51+
4. Copy and paste the GH0000 folder to create a duplicate test ("Copy of GH0000").
52+
5. Replace the four instances of GH0000 with your issue number.
53+
6. Edit the test as you see fit. Don't commit yet; there are details in a later step.
5154

5255
Do not use anymore the NHxxxx naming, they match issue numbers from https://nhibernate.jira.com/
5356

@@ -63,7 +66,9 @@ NHibernate has migrated its issue tracking from Jira to GitHub, and using the Ji
6366
4. Select and run the test.
6467
5. You can also make the test project your startup project and it will run NUnit when you press F5.
6568

66-
### Third Party NUnit Test Runner This would be something like ReSharper.
69+
### Third Party NUnit Test Runner
70+
71+
This could be something like ReSharper.
6772

6873
1. Sometimes tests fail when run under x64. If required (ex. SQLite and Firebird), go to the project properties Build tab and set the target to x86.
6974
2. Next, just run the tests as usual.
@@ -91,11 +96,11 @@ Please note that some tests assume a case insensitive accent sensitive database
9196

9297
## Submit a Pull Request
9398

94-
If you are fixing an existing issue, please make sure to include this issue number in your GitHub pull request.
99+
If you are fixing an existing issue, please make sure to include this issue number in your GitHub pull request. (Use the # prefix instead of GH for automatically having a link to it.)
95100

96-
We use tabs for code indentation, not spaces. As this is not the default in Visual Studio, you will need to reconfigure Visual Studio to indent with tabs whenever you work on the NHibernate codebase. To make this easier, NHibernate has an [editorconfig][3] configuration file to switch Visual Studio automatically between tabs and spaces mode. It is recommended you install editorconfig from the Visual Studio Extension Manager.
101+
We use tabs for code indentation, not spaces. To make this easier, NHibernate has an [editorconfig][3] configuration file to switch Visual Studio automatically between tabs and spaces mode.
97102

98-
After submitting your pull request, come back later to check the outcome of automated builds. If some have failed, they will be listed in your pull request with a link to the corresponding TeamCity build. Find out in the build which tests are newly failing, and take appropriate action. Some of those builds have many known failing tests, which does not trigger a build failure. A *Comparison.txt* file in build Artifacts may help finding which failing tests are not known failing tests and must be addressed.
103+
After submitting your pull request, come back later to check the outcome of automated builds. If some have failed, they will be listed in your pull request with a link to the corresponding TeamCity build. Find out in the build which tests are newly failing, and take appropriate action. Some of those builds may have known failing tests, which does not trigger a build failure. In this case a *Comparison.txt* file in build Artifacts may help finding which failing tests are not known failing tests and must be addressed.
99104

100105
## Further Discussion
101106

Tools/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.6.0" targetFramework="net461" />
88
<package id="NUnit.Extension.TeamCityEventListener" version="1.0.2" targetFramework="net461" />
99
<package id="NUnit.Extension.VSProjectLoader" version="3.6.0" targetFramework="net461" />
10-
<package id="CSharpAsyncGenerator.CommandLine" version="0.8.2.1" targetFramework="net461" />
10+
<package id="CSharpAsyncGenerator.CommandLine" version="0.8.2.6" targetFramework="net461" />
1111
<package id="vswhere" version="2.1.4" targetFramework="net461" />
1212
<package id="gitreleasemanager" version="0.7.0" targetFramework="net461" />
1313
</packages>

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 5.1.1.{build}
1+
version: 5.1.2.{build}
22
image: Visual Studio 2017
33
environment:
44
matrix:
@@ -63,4 +63,4 @@ on_finish:
6363
$wc = New-Object 'System.Net.WebClient'
6464
Get-Item '*-TestResult.xml' | ForEach-Object {
6565
$wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit3/$($env:APPVEYOR_JOB_ID)", $_)
66-
}
66+
}

build-common/NHibernate.props

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
<PropertyGroup>
44
<VersionMajor Condition="'$(VersionMajor)' == ''">5</VersionMajor>
55
<VersionMinor Condition="'$(VersionMinor)' == ''">1</VersionMinor>
6-
<VersionPatch Condition="'$(VersionPatch)' == ''">1</VersionPatch>
6+
<VersionPatch Condition="'$(VersionPatch)' == ''">2</VersionPatch>
77
<VersionSuffix Condition="'$(VersionSuffix)' == ''"></VersionSuffix>
88

99
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>
1010
<AssemblyVersion>$(VersionMajor).$(VersionMinor).0.0</AssemblyVersion>
1111
<FileVersion>$(VersionPrefix).0</FileVersion>
1212

13+
<NhAppTargetFrameworks>net461;netcoreapp2.0</NhAppTargetFrameworks>
14+
<NhLibTargetFrameworks>net461;netcoreapp2.0;netstandard2.0</NhLibTargetFrameworks>
15+
1316
<Product>NHibernate</Product>
1417
<Company>NHibernate.info</Company>
1518
<Copyright>Licensed under LGPL.</Copyright>

build-common/common.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
<!-- This is used only for build folder -->
1515
<!-- TODO: Either remove or refactor to use NHibernate.props -->
16-
<property name="project.version" value="5.1.1" overwrite="false" />
17-
<property name="project.version.numeric" value="5.1.1" overwrite="false" />
16+
<property name="project.version" value="5.1.2" overwrite="false" />
17+
<property name="project.version.numeric" value="5.1.2" overwrite="false" />
1818

1919
<!-- properties used to connect to database for testing -->
2020
<include buildfile="nhibernate-properties.xml" />

doc/reference/modules/basic_mapping.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2019,7 +2019,7 @@
20192019
name="PropertyName"
20202020
class="ClassName"
20212021
insert="true|false"
2022-
upate="true|false"
2022+
update="true|false"
20232023
access="field|property|nosetter|ClassName"
20242024
optimistic-lock="true|false">
20252025

doc/reference/modules/configuration.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,10 @@ in the parameter binding.</programlisting>
11351135
configuration file, nor supplied by using <literal>Configuration.SetProperties</literal>, nor
11361136
set in the <literal>hibernate.cfg.xml</literal> configuration file.
11371137
</para>
1138+
<para>
1139+
Alternatively to using the setting, a logger factory can be programmatically supplied by using
1140+
<literal>NHibernateLogger.SetLoggersFactory</literal>.
1141+
</para>
11381142
<para>
11391143
<emphasis role="strong">eg.</emphasis>
11401144
<literal>classname.of.LoggerFactory, assembly</literal>

doc/reference/modules/performance.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,20 +235,20 @@ int accessLevel = permissions["accounts"]; // Error!]]></programlisting>
235235
<literal>left join fetch</literal> in HQL. This tells NHibernate to fetch
236236
the association eagerly in the first select, using an outer join. In the
237237
<literal>ICriteria</literal> query API, you would use
238-
<literal>SetFetchMode(FetchMode.Join)</literal>.
238+
<literal>Fetch()</literal>.
239239
</para>
240240

241241
<para>
242242
If you ever feel like you wish you could change the fetching strategy used by
243243
<literal>Get()</literal> or <literal>Load()</literal>, simply use a
244244
<literal>ICriteria</literal> query, for example:
245245
</para>
246-
246+
247247
<programlisting><![CDATA[User user = session.CreateCriteria(typeof(User))
248-
.SetFetchMode("Permissions", FetchMode.Join)
248+
.Fetch(SelectMode.Fetch, "Permissions")
249249
.Add( Expression.Eq("Id", userId) )
250250
.UniqueResult<User>();]]></programlisting>
251-
251+
252252
<para>
253253
(This is NHibernate's equivalent of what some <emphasis>ORM</emphasis> solutions call a "fetch plan".)
254254
</para>
@@ -475,7 +475,7 @@ using(var iter = session
475475
<literal>NHibernateUtil.Initialize()</literal> for each collection that will
476476
be needed in the web tier (this call must occur before the session is closed)
477477
or retrieves the collection eagerly using a NHibernate query with a
478-
<literal>FETCH</literal> clause or a <literal>FetchMode.Join</literal> in
478+
<literal>FETCH</literal> clause or a <literal>SelectMode.Fetch</literal> in
479479
<literal>ICriteria</literal>. This is usually easier if you adopt the
480480
<emphasis>Command</emphasis> pattern instead of a <emphasis>Session Facade</emphasis>.
481481
</para>

doc/reference/modules/query_criteria.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,13 @@ foreach ( IDictionary map in cats )
175175

176176
<para>
177177
You may specify association fetching semantics at runtime using
178-
<literal>SetFetchMode()</literal>.
178+
<literal>Fetch()</literal>.
179179
</para>
180180

181181
<programlisting><![CDATA[var cats = sess.CreateCriteria<Cat>()
182182
.Add( Expression.Like("Name", "Fritz%") )
183-
.SetFetchMode("Mate", FetchMode.Eager)
184-
.SetFetchMode("Kittens", FetchMode.Eager)
183+
.Fetch(SelectMode.Fetch, "Mate")
184+
.Fetch(SelectMode.Fetch, "Kittens")
185185
.List<Cat>();]]></programlisting>
186186

187187
<para>

releasenotes.txt

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
1-
Build 5.1.1
1+
Build 5.1.2
2+
=============================
3+
4+
Release notes - NHibernate - Version 5.1.2
5+
6+
** Bug
7+
8+
* #1680 RowCount not working with JoinEntityAlias
9+
* #1672 Generated async methods do not correctly propagate OperationCanceledException
10+
* #1667 Collection initializing with zero rows after update to NH5
11+
* #1660 Wrong CopyTo implementation
12+
* #1650 Cannot use cache.use_sliding_expiration in hibernate.cfg.xml
13+
* #1585 Hashset unsupported by SetParameterList
14+
* #1355 NH-3928 - Random invalid SQL generated when using bitwise operators
15+
16+
** Task
17+
18+
* #1668 Merge 5.0.5 into 5.1.x
19+
* #1664 Release 5.1.2
20+
* #1659 Merge 5.0.4 into 5.1.x
21+
22+
As part of releasing 5.1.2, a missing 5.0.0 possible breaking change has been added about future queries with data
23+
providers not actually supporting them. See 5.0.0 possible breaking changes.
24+
25+
26+
Build 5.1.1
227
=============================
328

429
Release notes - NHibernate - Version 5.1.1
@@ -192,6 +217,34 @@ Release notes - NHibernate - Version 5.1.0
192217
As part of releasing 5.1.0, a missing 5.0.0 possible breaking change has been added about inequality semantic in LINQ
193218
queries. See 5.0.0 possible breaking changes.
194219

220+
Build 5.0.6
221+
=============================
222+
223+
Release notes - NHibernate - Version 5.0.6
224+
225+
** Bug
226+
* #1672 Generated async methods do not correctly propagate OperationCanceledException
227+
* #1355 NH-3928 - Random invalid SQL generated when using bitwise operators
228+
229+
** Task
230+
* #1686 Release 5.0.6
231+
232+
Build 5.0.5
233+
=============================
234+
235+
Release notes - NHibernate - Version 5.0.5
236+
237+
** Bug
238+
* #1665 Have IFutureEnumerable.GetEnumerable executing immediatly the query
239+
240+
Build 5.0.4
241+
=============================
242+
243+
Release notes - NHibernate - Version 5.0.4
244+
245+
** Bug
246+
* #1658 Add missing cache setting
247+
195248
Build 5.0.3
196249
=============================
197250

@@ -303,6 +356,10 @@ Build 5.0.0
303356
the dialect. They resolve to 4000 length string and (28, 10) precision/scale decimals by default, and are
304357
trimmed down according to dialect. Those defaults can be overridden with query.default_cast_length,
305358
query.default_cast_precision and query.default_cast_scale settings.
359+
* Future queries with data provider not actually supporting them (not supporting mutliple queries in a single
360+
SQL command) are no more immediately executed at the .Future call. They are executed only when directly
361+
enumerated or when their IFutureEnumerable.GetEnumerable method is called. (This aligns them with the behavior
362+
of FutureValue.)
306363
* Dialects are now configurable. If you instantiate a dialect directly, make sure you call its Configure
307364
method, with as argument the properties of a NHibernate Configuration object. You may use instead
308365
Dialect.GetDialect methods, which configure the dialect before returning it.
@@ -531,6 +588,14 @@ Release notes - NHibernate - Version 5.0.0
531588
* [NH-4011] - Fix transaction scopes handling
532589

533590

591+
Build 4.1.2.GA
592+
=============================
593+
594+
Release notes - NHibernate - Version 4.1.2.GA
595+
596+
** Bug
597+
* #1355 NH-3928 - Random invalid SQL generated when using bitwise operators
598+
534599
Build 4.1.1.GA
535600
=============================
536601

src/AsyncGenerator.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,20 @@
191191
preserveReturnType:
192192
- hasAttributeName: TestAttribute
193193
- hasAttributeName: TheoryAttribute
194+
alwaysAwait:
195+
- hasAttributeName: TestAttribute
196+
- hasAttributeName: TheoryAttribute
197+
- hasAttributeName: SetUpAttribute
198+
- hasAttributeName: TearDownAttribute
194199
typeConversion:
195200
- conversion: Ignore
196201
name: ObjectAssert
197202
- conversion: Ignore
198203
name: LinqReadonlyTestsContext
199204
- conversion: Ignore
200205
name: MultiThreadRunner
206+
- conversion: Ignore
207+
name: PeVerifier
201208
- conversion: Ignore
202209
hasAttributeName: IgnoreAttribute
203210
- conversion: NewType

src/NHibernate.DomainModel/NHibernate.DomainModel.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="../../build-common/NHibernate.props" />
33
<PropertyGroup>
44
<Description>The Domain Model used by the Unit Tests.</Description>
5-
<TargetFrameworks>netstandard2.0;net461;netcoreapp2.0</TargetFrameworks>
5+
<TargetFrameworks>$(NhLibTargetFrameworks)</TargetFrameworks>
66
<IsTestProject>true</IsTestProject>
77
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
88
</PropertyGroup>

src/NHibernate.Test.VisualBasic/NHibernate.Test.VisualBasic.vbproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="../../build-common/NHibernate.props" />
33
<PropertyGroup>
44
<Description>The Visual Basic Unit Tests for NHibernate.</Description>
5-
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
5+
<TargetFrameworks>$(NhAppTargetFrameworks)</TargetFrameworks>
66
<IsTestProject>true</IsTestProject>
77
<NoWarn>$(NoWarn);3001;3002;3003;3005</NoWarn>
88
<OptionExplicit>On</OptionExplicit>
@@ -32,7 +32,7 @@
3232
<PackageReference Include="Microsoft.VisualBasic" Version="10.2.0" />
3333
</ItemGroup>
3434
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
35-
<PackageReference Include="NUnitLite" Version="3.9.0" />
35+
<PackageReference Include="NUnitLite" Version="3.10.1" />
3636
</ItemGroup>
3737
<ItemGroup>
3838
<ProjectReference Include="..\NHibernate\NHibernate.csproj" />

src/NHibernate.Test/Async/CacheTest/CacheFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ namespace NHibernate.Test.CacheTest
2222
public class CacheFixtureAsync
2323
{
2424
[Test]
25-
public Task TestSimpleCacheAsync()
25+
public async Task TestSimpleCacheAsync()
2626
{
27-
return DoTestCacheAsync(new HashtableCacheProvider());
27+
await (DoTestCacheAsync(new HashtableCacheProvider()));
2828
}
2929

3030
private CacheKey CreateCacheKey(string text)

src/NHibernate.Test/Async/Cascade/Circle/MultiPathCircleCascadeTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ public async Task MergeEntityWithNonNullableEntityNullAsync()
155155
await (session.MergeAsync(route, cancellationToken));
156156
Assert.Fail("should have thrown an exception");
157157
}
158+
catch (OperationCanceledException) { throw; }
158159
catch (Exception ex)
159160
{
160161
Assert.That(ex, Is.TypeOf(typeof(PropertyValueException)));

src/NHibernate.Test/Async/CfgTest/ConfigurationFixture.cs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,9 @@ public async Task ManualConfigurationAsync()
6565
/// <see cref="Configuration" /> works as intended.
6666
/// </summary>
6767
[Test]
68-
public Task SetDefaultAssemblyAndNamespaceAsync()
68+
public async Task SetDefaultAssemblyAndNamespaceAsync()
6969
{
70-
try
71-
{
72-
string hbmFromDomainModel =
70+
string hbmFromDomainModel =
7371
@"<?xml version='1.0' ?>
7472
<hibernate-mapping xmlns='urn:nhibernate-mapping-2.2'>
7573
<class name='A'>
@@ -79,7 +77,7 @@ public Task SetDefaultAssemblyAndNamespaceAsync()
7977
</class>
8078
</hibernate-mapping>";
8179

82-
string hbmFromTest =
80+
string hbmFromTest =
8381
@"<?xml version='1.0' ?>
8482
<hibernate-mapping xmlns='urn:nhibernate-mapping-2.2'>
8583
<class name='LocatedInTestAssembly' lazy='false'>
@@ -89,23 +87,18 @@ public Task SetDefaultAssemblyAndNamespaceAsync()
8987
</class>
9088
</hibernate-mapping>";
9189

92-
Configuration cfg = new Configuration();
93-
cfg
90+
Configuration cfg = new Configuration();
91+
cfg
9492
.SetDefaultAssembly("NHibernate.DomainModel")
9593
.SetDefaultNamespace("NHibernate.DomainModel")
9694
.AddXmlString(hbmFromDomainModel);
9795

98-
cfg
96+
cfg
9997
.SetDefaultAssembly("NHibernate.Test")
10098
.SetDefaultNamespace(typeof(LocatedInTestAssembly).Namespace)
10199
.AddXmlString(hbmFromTest);
102100

103-
return cfg.BuildSessionFactory().CloseAsync();
104-
}
105-
catch (Exception ex)
106-
{
107-
return Task.FromException<object>(ex);
108-
}
101+
await (cfg.BuildSessionFactory().CloseAsync());
109102
}
110103

111104
public class SampleQueryProvider : DefaultQueryProvider

0 commit comments

Comments
 (0)