Skip to content

Commit c412e1d

Browse files
authored
Merge branch 'master' into projectionAliases
2 parents 0ac4144 + 4bd76b2 commit c412e1d

File tree

251 files changed

+8468
-5753
lines changed

Some content is hidden

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

251 files changed

+8468
-5753
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ TestResult.xml
1818
.idea/
1919
.vs/
2020
/build-common/NHibernate.dev.props
21+
/doc/reference/master.xml

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ including [howtos][A1], [blogs][A2] and [reference documentation][A3].
1111
[A2]: http://nhibernate.info/blog/
1212
[A3]: http://nhibernate.info/doc/nh/en/index.html
1313

14-
Latest Version
14+
Latest Release Version
1515
--------------
1616

1717
The quickest way to get the latest release of NHibernate is to add it to your project using
@@ -22,6 +22,24 @@ Alternatively binaries are available from SourceForge at <http://sourceforge.net
2222
You are encouraged to review the release notes ([releasenotes.txt](releasenotes.txt)), particularly when upgrading to a
2323
later version. The release notes will generally document any breaking changes.
2424

25+
Nightly Development Builds
26+
--------------------------
27+
28+
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>).
30+
31+
In order to make life a little bit easier you can register the package source in the NuGet.Config
32+
file in the top folder of your project, similar to the following.
33+
34+
```xml
35+
<?xml version="1.0" encoding="utf-8"?>
36+
<configuration>
37+
<packageSources>
38+
<add key="NHibernateDevBuilds" value="https://www.myget.org/F/nhibernate/api/v3/index.json" />
39+
</packageSources>
40+
</configuration>
41+
```
42+
2543
Community Forums
2644
----------------
2745

ReleaseProcedure.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ Tools\gitreleasemanager\0.7.0\tools\GitReleaseManager.exe create -o nhibernate -
2525
If the release tag does not match the released version with major.minor.release
2626
formalism, the NuGet package will have an invalid link to release notes.
2727

28-
* Check/update version number in common.xml and NHibernate.props under
29-
build-common folder, in master.xml under doc\reference folder, and in
30-
appveyor.yml in the NHibernate root.
28+
* Check/update version number in NHibernate.props under build-common folder.
29+
Clear VersionSuffix if present.
3130

3231
* Don't forget to commit the above.
3332

@@ -55,3 +54,10 @@ Tools\gitreleasemanager\0.7.0\tools\GitReleaseManager.exe create -o nhibernate -
5554
* If this was a stable branch, merge it forward to master. Perhaps some
5655
changes need to be edited out in the merge, but this will reduce the
5756
risk of some issue being left unfixed on master.
57+
58+
* If this was the master branch, create the stable branch for the new release, named
59+
according to its version with "x" instead of its patch number. By example, "5.3.x".
60+
61+
* If next version is decided set it in NHibernate.props under build-common folder
62+
(in most cases - increment minor version) and set VersionSuffix to "dev".
63+
Commit it directly (without going through a PR).

Tools/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
nuget.exe
21
nunit.*
32
vswhere/
43
csharpasyncgenerator.commandline/

Tools/packages.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="CSharpAsyncGenerator.CommandLine" Version="0.18.1" />
14+
<PackageReference Include="CSharpAsyncGenerator.CommandLine" Version="0.18.2" />
1515
<PackageReference Include="vswhere" Version="2.1.4" />
1616
<PackageReference Include="NUnit.Console" Version="3.10.0" />
1717
<PackageReference Include="GitReleaseManager" Version="0.7.0" />

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 5.2.7.{build}
1+
version: '{build}'
22
image: Visual Studio 2017
33
environment:
44
matrix:

build-common/NHibernate.props

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22
<Import Condition="Exists('NHibernate.dev.props')" Project="NHibernate.dev.props"/>
33

44
<PropertyGroup>
5-
<VersionMajor Condition="'$(VersionMajor)' == ''">5</VersionMajor>
6-
<VersionMinor Condition="'$(VersionMinor)' == ''">2</VersionMinor>
7-
<VersionPatch Condition="'$(VersionPatch)' == ''">7</VersionPatch>
8-
<VersionSuffix Condition="'$(VersionSuffix)' == ''"></VersionSuffix>
5+
<NhVersion Condition="'$(NhVersion)' == ''" >5.3</NhVersion>
6+
<VersionPatch Condition="'$(VersionPatch)' == ''">0</VersionPatch>
7+
<!-- Clear VersionSuffix for making release and set it to dev for making development builds -->
8+
<VersionSuffix Condition="'$(VersionSuffix)' == ''">dev</VersionSuffix>
99

10-
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>
11-
<AssemblyVersion>$(VersionMajor).$(VersionMinor).0.0</AssemblyVersion>
12-
<FileVersion>$(VersionPrefix).0</FileVersion>
10+
<VersionPrefix Condition="'$(VersionPrefix)' == ''">$(NhVersion).$(VersionPatch)</VersionPrefix>
11+
<VersionSuffix Condition="'$(VersionSuffix)' != '' AND '$(BuildNumber)' != ''">$(VersionSuffix).$(BuildNumber)</VersionSuffix>
12+
<AssemblyVersion>$(NhVersion).0.0</AssemblyVersion>
13+
<FileVersion Condition="'$(VersionSuffix)' != '' AND '$(BuildNumber)' != ''">$(VersionPrefix).$(BuildNumber)</FileVersion>
14+
<FileVersion Condition="'$(FileVersion)' == ''">$(VersionPrefix).0</FileVersion>
1315

1416
<NhAppTargetFrameworks Condition ="$(NhAppTargetFrameworks) == ''">net461;netcoreapp2.0</NhAppTargetFrameworks>
1517
<NhLibTargetFrameworks Condition ="$(NhLibTargetFrameworks) == ''">net461;netcoreapp2.0;netstandard2.0</NhLibTargetFrameworks>
@@ -27,7 +29,8 @@
2729
<PackageIconUrl>https://raw.githubusercontent.com/nhibernate/nhibernate-core/master/logo/NHibernate-NuGet.png</PackageIconUrl>
2830
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
2931
<PackageLicenseExpression>LGPL-2.1-only</PackageLicenseExpression>
30-
<PackageReleaseNotes>https://github.com/nhibernate/nhibernate-core/blob/$(VersionPrefix)/releasenotes.txt</PackageReleaseNotes>
32+
<PackageReleaseNotes Condition="'$(VersionSuffix)' == ''">https://github.com/nhibernate/nhibernate-core/blob/$(VersionPrefix)/releasenotes.txt</PackageReleaseNotes>
33+
<PackageReleaseNotes Condition="'$(PackageReleaseNotes)' == ''">This is development version for testing purposes only</PackageReleaseNotes>
3134
<PublishRepositoryUrl>true</PublishRepositoryUrl>
3235
<IncludeSymbols>true</IncludeSymbols>
3336
<SymbolPackageFormat>snupkg</SymbolPackageFormat>

build-common/common.xml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,31 @@
1111
<!-- Path to the folder that contain the external assemblies -->
1212
<property name="lib.dir" value="lib" dynamic="true" />
1313

14-
<!-- This is used only for build folder -->
15-
<!-- TODO: Either remove or refactor to use NHibernate.props -->
16-
<property name="project.version" value="5.2.7" overwrite="false" />
17-
<property name="project.version.numeric" value="5.2.7" overwrite="false" />
14+
<!-- This is used for build folder and also for "API Reference" docs (not active task, see doc/NHibernate.shfbproj.template) -->
15+
<target name="get-project-version">
16+
<xmlpeek
17+
file="${root.dir}/build-common/NHibernate.props"
18+
xpath="/Project/PropertyGroup/NhVersion"
19+
property="version.short" />
20+
<xmlpeek
21+
file="${root.dir}/build-common/NHibernate.props"
22+
xpath="/Project/PropertyGroup/VersionPatch"
23+
property="version.patch" />
24+
<property name="project.version" value="${version.short}.${version.patch}" />
25+
</target>
26+
27+
<target name="set-doc-version">
28+
<copy file="${root.dir}/doc/reference/master.template.xml" tofile="${root.dir}/doc/reference/master.xml" overwrite="true" />
29+
<xmlpoke
30+
file="${root.dir}/doc/reference/master.xml"
31+
xpath="/book/bookinfo/releaseinfo"
32+
value="${version.short}" />
33+
</target>
1834

1935
<!-- properties used to connect to database for testing -->
2036
<include buildfile="nhibernate-properties.xml" />
2137

22-
<target name="common.init" description="Initializes build properties">
38+
<target name="common.init" depends="get-project-version" description="Initializes build properties">
2339
<property name="project.config" value="debug" overwrite="false" />
2440
<property name="build.name" value="NHibernate-${project.version}" if="${project.config == 'release'}"/>
2541
<property name="build.name" value="NHibernate-${project.version}-${project.config}" unless="${project.config == 'release'}" />
@@ -31,14 +47,6 @@
3147
<property name="tools.dir" value="${root.dir}/Tools"/>
3248
</target>
3349

34-
<target name="common.download-nuget" depends="common.init">
35-
<get
36-
src="https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
37-
dest="${tools.dir}/nuget.exe"
38-
usetimestamp="true"
39-
/>
40-
</target>
41-
4250
<target name="common.tools-restore" depends="common.init">
4351
<exec workingdir="${root.dir}/Tools" program="dotnet" verbose="true">
4452
<arg line="restore ./packages.csproj --packages ." />

default.build

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<project
33
name="NHibernate"
44
default="build"
5-
xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd"
5+
xmlns="http://nant.sf.net/release/0.90/nant.xsd"
66
>
77

88
<property name="root.dir" value="." />
@@ -21,14 +21,14 @@
2121
</target>
2222

2323
<target name="nuget.set-properties">
24-
<property name="nuget.nupackages.relative-dir" value="nuget_gallery" />
25-
<property name="nuget.nupackages.dir" value="${build.dir}/${nuget.nupackages.relative-dir}" />
24+
<property name="nuget.nupackages.dir" value="${build.dir}/nuget_gallery" />
2625
<property name="nuget.nupackages.pushbatfile" value="${nuget.nupackages.dir}/NuGetPush.bat" />
2726
</target>
2827

2928
<target name="build"
3029
depends="init prepare-build-directory nuget.set-properties"
3130
description="Builds NHibernate in the current configuration">
31+
<property name="build.counter" value="" overwrite="false" />
3232

3333
<exec program="dotnet" verbose="true">
3434
<arg value="msbuild" />
@@ -39,6 +39,8 @@
3939
<arg value="/p:IncludeSymbols=&quot;True&quot;" />
4040
<arg value="/p:IncludeSource=&quot;True&quot;" />
4141
<arg value="/p:PackageOutputPath=&quot;${path::get-full-path(nuget.nupackages.dir)}&quot;" />
42+
<!-- build.counter is not available by default. It needs to be exposed in Team City as system parameter system.build.counter with value %build.counter% -->
43+
<arg value="/p:BuildNumber=&quot;${build.counter}&quot;" unless="${build.counter == ''}" />
4244
<arg value="/t:Restore" />
4345
<arg value="/t:Rebuild" />
4446
<arg value="/v:q" />
@@ -310,11 +312,9 @@
310312

311313
</target>
312314

313-
<target name="nugetpushbat" depends="init binaries common.download-nuget nuget.set-properties"
315+
<target name="nugetpushbat" depends="init binaries nuget.set-properties"
314316
description="Creates files for the release on nuget gallery.">
315317

316-
<copy file="${tools.dir}/NuGet.exe" todir="${nuget.nupackages.dir}"/>
317-
318318
<echo message="rem In order to use this bat you have to be sure you have executed 'nuget SetApiKey' ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="false"/>
319319
<foreach item="File" property="filename">
320320
<in>
@@ -323,12 +323,12 @@
323323
</items>
324324
</in>
325325
<do>
326-
<echo message="nuget push -source https://api.nuget.org/v3/index.json ${path::get-file-name(filename)} ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="true"/>
326+
<echo message="dotnet nuget push -s https://api.nuget.org/v3/index.json ${path::get-file-name(filename)} ${environment::newline()}" file="${nuget.nupackages.pushbatfile}" append="true"/>
327327
</do>
328328
</foreach>
329329
</target>
330330

331-
<target name="nugetpush" depends="init binaries common.download-nuget nuget.set-properties"
331+
<target name="nugetpush" depends="init binaries nuget.set-properties"
332332
description="Push packages on nuget gallery.">
333333
<!-- In order to use this task you have to be sure you have executed 'nuget SetApiKey' -->
334334
<foreach item="File" property="filename">
@@ -338,7 +338,8 @@
338338
</items>
339339
</in>
340340
<do>
341-
<exec basedir="${tools.dir}" workingdir="${nuget.nupackages.dir}" program="NuGet.exe">
341+
<exec basedir="${tools.dir}" workingdir="${nuget.nupackages.dir}" program="dotnet">
342+
<arg value="nuget" />
342343
<arg value="push" />
343344
<arg value="${filename}" />
344345
</exec>

doc/NHibernate.shfbproj.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
<HtmlHelpName>NHibernateAPI</HtmlHelpName>
1919
<HelpFileFormat>HtmlHelp1x</HelpFileFormat>
2020
<CopyrightText>NHibernate</CopyrightText>
21-
<CopyrightHref>nhibernate.info</CopyrightHref>
22-
<FeedbackEMailAddress>http://groups.google.com/group/nhibernate-development</FeedbackEMailAddress>
21+
<CopyrightHref>https://nhibernate.info</CopyrightHref>
22+
<FeedbackEMailAddress>https://groups.google.com/group/nhibernate-development</FeedbackEMailAddress>
2323
<FeedbackEMailLinkText>nhibernate team</FeedbackEMailLinkText>
2424
<HelpTitle>NHibernate API Reference</HelpTitle>
2525
<IndentHtml>False</IndentHtml>
26-
<HelpFileVersion>${project.version.numeric}</HelpFileVersion>
26+
<HelpFileVersion>${project.version}</HelpFileVersion>
2727
<DocumentationSources>
2828
<DocumentationSource sourceFile="${root.dir}/src/NHibernate/bin/${build.config}/net461/NHibernate.dll" />
2929
<DocumentationSource sourceFile="${root.dir}/src/NHibernate/bin/${build.config}/net461/Nhibernate.xml" />

doc/reference/master.xml renamed to doc/reference/master.template.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<bookinfo>
4040
<title>NHibernate - Relational Persistence for Idiomatic .NET</title>
4141
<subtitle>NHibernate Reference Documentation</subtitle>
42-
<releaseinfo>5.2</releaseinfo>
42+
<releaseinfo></releaseinfo>
4343
</bookinfo>
4444

4545
<toc />

doc/reference/reference.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<property name="root.dir" value="../.." />
99
<include buildfile="${root.dir}/build-common/common.xml" />
1010

11-
<target name="init" depends="common.init">
11+
<target name="init" depends="common.init set-doc-version">
1212
<property name="lang" value="en" />
1313

1414
<property name="output.dir" value="${build.dir}/doc" />

src/NHibernate.DomainModel/Northwind/Entities/Animal.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ public class Animal
1212
public virtual Animal Father { get; set; }
1313
public virtual IList<Animal> Children { get; set; }
1414
public virtual string SerialNumber { get; set; }
15-
}
15+
16+
public virtual Animal FatherOrMother => Father ?? Mother;
17+
}
1618

1719
public abstract class Reptile : Animal
1820
{
@@ -30,4 +32,4 @@ public abstract class Mammal : Animal
3032
public class Dog : Mammal { }
3133

3234
public class Cat : Mammal { }
33-
}
35+
}

src/NHibernate.Test/Ado/BatcherFixture.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Collections;
21
using NHibernate.AdoNet;
32
using NHibernate.Cfg;
43
using NUnit.Framework;
@@ -44,11 +43,11 @@ public void OneRoundTripInserts()
4443
private void Cleanup()
4544
{
4645
using (ISession s = Sfi.OpenSession())
47-
using (s.BeginTransaction())
46+
using (var t = s.BeginTransaction())
4847
{
4948
s.CreateQuery("delete from VerySimple").ExecuteUpdate();
5049
s.CreateQuery("delete from AlmostSimple").ExecuteUpdate();
51-
s.Transaction.Commit();
50+
t.Commit();
5251
}
5352
}
5453

src/NHibernate.Test/Ado/GenericBatchingBatcherFixture.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Collections;
32
using System.Diagnostics;
43
using System.Linq;
54
using NHibernate.AdoNet;
@@ -229,10 +228,10 @@ private void DbShoudBeEmpty()
229228
private void Cleanup()
230229
{
231230
using (var s = Sfi.OpenSession())
232-
using (s.BeginTransaction())
231+
using (var t = s.BeginTransaction())
233232
{
234233
s.CreateQuery("delete from VerySimple").ExecuteUpdate();
235-
s.Transaction.Commit();
234+
t.Commit();
236235
}
237236
}
238237

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Collections;
21
using NUnit.Framework;
32

43
namespace NHibernate.Test.Any
@@ -24,30 +23,36 @@ protected override string CacheConcurrencyStrategy
2423
[Test]
2524
public void FlushProcessing()
2625
{
26+
var person = new Person();
27+
var address = new Address();
2728
//http://opensource.atlassian.com/projects/hibernate/browse/HHH-1663
28-
ISession session = OpenSession();
29-
session.BeginTransaction();
30-
Person person = new Person();
31-
Address address = new Address();
32-
person.Data = address;
33-
session.SaveOrUpdate(person);
34-
session.SaveOrUpdate(address);
35-
session.Transaction.Commit();
36-
session.Close();
29+
using (var session = OpenSession())
30+
using (var tran = session.BeginTransaction())
31+
{
32+
person.Data = address;
33+
session.SaveOrUpdate(person);
34+
session.SaveOrUpdate(address);
35+
tran.Commit();
36+
session.Close();
37+
}
3738

38-
session = OpenSession();
39-
session.BeginTransaction();
40-
person = (Person) session.Load(typeof (Person), person.Id);
41-
person.Name = "makingpersondirty";
42-
session.Transaction.Commit();
43-
session.Close();
39+
using (var session = OpenSession())
40+
using (var tran = session.BeginTransaction())
41+
{
42+
person = (Person) session.Load(typeof(Person), person.Id);
43+
person.Name = "makingpersondirty";
44+
tran.Commit();
45+
session.Close();
46+
}
4447

45-
session = OpenSession();
46-
session.BeginTransaction();
47-
session.Delete(person);
48-
session.Delete(address);
49-
session.Transaction.Commit();
50-
session.Close();
48+
using (var session = OpenSession())
49+
using (var tran = session.BeginTransaction())
50+
{
51+
session.Delete(person);
52+
session.Delete(address);
53+
tran.Commit();
54+
session.Close();
55+
}
5156
}
5257
}
53-
}
58+
}

0 commit comments

Comments
 (0)